• Could not execute JDBC batch update 6.2.5

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #40388  by omnicron
 
I have an issue with a folder a user uploaded that for some reason duplicated itself with all it subfolders and files around 1000+ times.

I went to delete the subfolder with all its files and I get an

"Could not execute JDBC batch" after about 2+ hours.

I can not delete the folder due to this error message.

OpenKM 6.2.5
Ubuntu 14.04.2 LTS
Mysql 5.6.19

Any ideas?

Thanks!
 #40398  by jllort
 
This is an old bug what on latest version is yet solved ( My mistake was allowed copy or move the contents into himselft and that caused infinite loop ).

You will not solve from UI, must be done by scripting accessing database at low level when deleting nodes. First of all stop openkm to be sure the looping process is definitively stopped.

Take this script as sample http://wiki.openkm.com/index.php/Script ... _traversal and do some modifications:
Code: Select all
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.openkm.api.*;
import com.openkm.bean.*;
 
Logger log = LoggerFactory.getLogger("com.openkm.scripting");
int MAX_DEPTH = Integer.MAX_VALUE;
 
void nodeTask(String path, int depth) throws Exception {
    for (Folder fld : OKMFolder.getInstance().getChildren(null, path)) {
        log.info("Folder: {}", level);
 
        if (depth < MAX_DEPTH) {
            nodeTask(fld.getPath(), depth + 1);
        }
    }
    OKMFolder.getInstance().purge(null, path);
}
 
log.info("***** Process BEGIN *****");
nodeTask("/okm:root", 0);
log.info("***** Process END *****");
IMPORTANT CHANGE THE nodeTask("/okm:root", 0); for the node you want to start deleting. The idea is go at the end and start backwards deleting. The proces can take several hours or days before be completed ( do not stop the openkm service while be running ). The purge methods removes definitively the node without going to trash.

When you get it solved migrate to latest 6.3 version
 #40413  by KittyCathy
 
IMPORTANT CHANGE THE nodeTask("/okm:root", 0); for the node you want to start deleting. The idea is go at the end and start backwards deleting. The proces can take several hours or days before be completed ( do not stop the openkm service while be running ). The purge methods removes definitively the node without going to trash.
Really? Already I was afraid that something messed up
 #40416  by omnicron
 
I got this error...

Sourced file: inline evaluation of: ``import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.openkm.api . . . '' : target exception : at Line: 10 : in file: inline evaluation of: ``import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.openkm.api . . . '' : .getChildren ( null , path ) Target exception: java.lang.StackOverflowError


It seemed to run for awhile. Is there just too many folders?
 #40418  by omnicron
 
Here is the script I am running.


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.openkm.api.*;
import com.openkm.bean.*;

Logger log = LoggerFactory.getLogger("com.openkm.scripting");
int MAX_DEPTH = Integer.MAX_VALUE;

void nodeTask(String path, int depth) throws Exception {


for (Folder fld : OKMFolder.getInstance().getChildren(null, path)) {
log.info("Folder: {}", fld.getPath());

if (depth < MAX_DEPTH) {
nodeTask(fld.getPath(), depth + 1);
}
}
}

log.info("***** Process BEGIN *****");
nodeTask("/okm:root/path 2 folder", 0);
log.info("***** Process END *****");




Here is the error I get a few minutes after.

Sourced file: inline evaluation of: ``import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.openkm.api . . . '' : target exception : at Line: 12 : in file: inline evaluation of: ``import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.openkm.api . . . '' : .getChildren ( null , path ) Target exception: java.lang.StackOverflowError
 #40430  by jllort
 
Seems you should increase the ram of the tomcat ( increase the maxpermsize at setenv.bat to 1024m )
 #40444  by omnicron
 
Right now my settings are the following.

-Xms4096m -Xmx4096m -XX:PermSize=1024m -XX:MaxPermSize=2024m -Xss1g -Djava.awt.headless=true -Dfile.encoding=utf-8


maxperm size would not solve the issue.. I had to add -Xsss1g ( or some number) Java default is 512m which was exhausting the stack with the recursion of the directories.

I had it set to 8m and it worked for long but did not finish... now I set it to 1g and it has been running for 8 hours and is still not done... this is THOUSANDS of folders with 5 subfolders per folder...


I hope this fixes it soon.
 #40445  by omnicron
 
On executing the script. I think I am doing this correctly...

I pasted the script into the scripting screen under the administration panel in OpenKM and pressed the evaluate button..

I can see the script running on catalina.out showing each directory traversal... it is at a few thousand right now....

About 4 hours into the running the OpenKM screen shows "An internal server error occurred. Please try again later." but I still see the logging of the script running...

I tried adding the script to start.bsh but not all the classes are loaded and it does not run properly....

Better ideas?
 #40458  by omnicron
 
I am getting a new error message.
Code: Select all
2015-09-07 02:22:21,124 [Thread-1468] WARN  com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN  com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN  com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN  com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN  com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN  com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN  com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN  com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN  com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN  com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN  com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN  com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN  com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN  com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] INFO  com.openkm.module.db.stuff.DbSimpleAccessManager - ***************************
2015-09-07 02:22:21,124 [Thread-1468] INFO  com.openkm.module.db.stuff.DbSimpleAccessManager - ***************************
THOUSANDS of times in catalina.out
 #40471  by jllort
 
Stop the application and start again. Probably will be better use systemToken rather null.

import com.openkm.module.db.stuff.DbSessionManager;
String systemToken = DbSessionManager.getInstance().getSystemToken();
 #40490  by jllort
 
Modify previous script adding these line at the beggining, then when you call methods replace null for systemToken.
for (Folder fld : OKMFolder.getInstance().getChildren(null, path)) to for (Folder fld : OKMFolder.getInstance().getChildren(systemToken, path)) and also the call of purge method.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.