Update: I changed my program so that database (B) is only read from once at the start of the operation, and after the initial read (B) is only written to with db:replace(). I now get this error from database (B) after about 3000 successful db:replace() actions:
Caused by: java.io.IOException: Stopped at ., 1/336: [bxerr:BXDB0002] Database ... is being updated, or update was not completed. at baseximporter.BaseXClient$Query.exec(BaseXClient.java:465) at baseximporter.BaseXClient$Query.execute(BaseXClient.java:425) at baseximporter.BaseXManager.updateIndex(BaseXManager.java:152) ... 10 more As before, database (B) is left in an unusable state after the error. Please let me know of any suggestions. Thanks, Vincent -----Original Message----- From: basex-talk-boun...@mailman.uni-konstanz.de [mailto:basex-talk-boun...@mailman.uni-konstanz.de] On Behalf Of Lizzi, Vincent Sent: Wednesday, August 06, 2014 6:48 PM To: basex-talk@mailman.uni-konstanz.de Subject: [basex-talk] locking problem I've written a process using the Java BaseXClient to load XML documents to one database (A) and save a small amount of data about each document in a second database (B) using a parallel document path. The data in (B) includes a sha1 hash which is used to determine if the source XML document has changed or not to avoid unnecessary reloading. With database (A) the replace command is used to import documents. With database (B) a query is run to get the current sha1 hash (if any) and the db:replace() function is used to create/update a document for each document in (A). This works well for small sets of documents, often loading several documents per second. However after 1,000 - 4,000 documents it eventually crashes with this exception: [bxerr:BXDB0002] Database (B) is being updated, or update was not completed. The exception is thrown when reading the sha1 hash from (B). After this exception, it's not possible to connect to database (B) even with the BaseX GUI unless I manually delete the upd.basex file. I have to delete both databases and try again. No other processes are accessing the databases. It seems like this problem is related to the high number of reads and writes happening on (B). Has anyone encountered a similar problem or have any suggestions? Thanks, Vincent