Hi all,
After migration to BaseX77, db:optimize is running into an exception:
java.io.IOException: Stopped at ., 8/20:
[java] [FOUP0002] Database 'xxx' is currently opened by another process.
Before migration, I used BaseX761-20130303.204518, and this version worked well.
I have an additional question:
My task is to read objects from a file and replace (if already exists)
or insert (if new) the objects in the database. The key is a specific
attribute (@n). Parallel threads could exist.
Could you suggest a better solution?
Here is the log with the exception:
21:32:37.860 127.0.0.1:48933 admin OK Database 'stock_stock_work__DOM' was opened in 74.98 ms. 78.19 ms
21:32:37.865 127.0.0.1:48933 admin REQUEST SET BINDINGS 'b1b987d9-3cdb-4ac4-bc83-13bd03eb7a13':db=stock_stock_work__DOM,'b1b987d9-3cdb-4ac4-bc83-13bd03eb7a13':destination=/tmp/basex/82e63b48-978d-4498-97bc-e90c8a3cd357/stock_stock_work__DOM,'b1b987d9-3cdb-4ac4-bc83-13bd03eb7a13':uuid=82e63b48-978d-4498-97bc-e90c8a3cd357
21:32:37.866 127.0.0.1:48933 admin OK BINDINGS: 'b1b987d9-3cdb-4ac4-bc83-13bd03eb7a13':db=stock_stock_work__DOM,'b1b987d9-3cdb-4ac4-bc83-13bd03eb7a13':destination=/tmp/basex/82e63b48-978d-4498-97bc-e90c8a3cd357/stock_stock_work__DOM,'b1b987d9-3cdb-4ac4-bc83-13bd03eb7a13':uuid=82e63b48-978d-4498-97bc-e90c8a3cd357 6.11 ms
21:32:37.869 127.0.0.1:48933 admin REQUEST SET AUTOFLUSH FALSE
21:32:37.869 127.0.0.1:48933 admin OK AUTOFLUSH: OFF 1.36 ms
21:32:37.915 127.0.0.1:48933 admin OK QUERY[0] xquery version '3.0'; declare namespace uuid='b1b987d9-3cdb-4ac4-bc83-13bd03eb7a13'; declare variable $uuid:db as xs:string external; declare variable $uuid:destination as xs:string external; let $step := ( 1 ) return db:add($uuid:db, $uuid:destination) 44.64 ms
21:32:38.208 127.0.0.1:48933 admin OK RESULTS[0] 291.49 ms
21:32:38.208 127.0.0.1:48933 admin OK INFO[0] 0.19 ms
21:32:38.249 127.0.0.1:48933 admin OK QUERY[1] xquery version '3.0'; declare namespace uuid='b1b987d9-3cdb-4ac4-bc83-13bd03eb7a13'; declare variable $uuid:db as xs:string external; declare variable $uuid:uuid as xs:string external; let $step := ( 1 ) let $prefix := concat($uuid:uuid, '/') let $suffix := concat('.', $uuid:uuid, '.xml') let $new := distinct-values( for $i in db:list($uuid:db) let $n := data(db:open($uuid:db,$i)/*/@n) where ends-with($i,$suffix) return $n ) for $i in db:list($uuid:db) let $old := concat($prefix, $i) where (index-of($new, data(db:open($uuid:db, $i)/*/@n))) and not(ends-with($i,$suffix)) return db:rename($uuid:db, $i, $old) 42.09 ms
21:32:38.359 127.0.0.1:48933 admin OK RESULTS[1] 108.12 ms
21:32:38.360 127.0.0.1:48933 admin OK INFO[1] 0.2 ms
21:32:38.400 127.0.0.1:48933 admin OK QUERY[2] xquery version '3.0'; declare namespace uuid='b1b987d9-3cdb-4ac4-bc83-13bd03eb7a13'; declare variable $uuid:db as xs:string external; declare variable $uuid:uuid as xs:string external; let $prefix := concat($uuid:uuid, '/') return db:delete($uuid:db,$prefix) 40.65 ms
21:32:38.444 127.0.0.1:48933 admin OK RESULTS[2] 43.14 ms
21:32:38.484 127.0.0.1:48933 admin OK INFO[2] 39.64 ms
21:32:38.525 127.0.0.1:48933 admin OK QUERY[3] xquery version '3.0'; declare namespace uuid='b1b987d9-3cdb-4ac4-bc83-13bd03eb7a13'; declare variable $uuid:db as xs:string external; declare variable $uuid:uuid as xs:string external; let $suffix := concat('.', $uuid:uuid, '.xml') for $i in db:list($uuid:db) let $new := substring-before($i,$suffix) where ends-with($i,$suffix) return db:rename($uuid:db, $i, $new) 41.45 ms
21:32:38.576 127.0.0.1:48933 admin OK RESULTS[3] 49.48 ms
21:32:38.616 127.0.0.1:48933 admin OK INFO[3] 39.85 ms
21:32:38.657 127.0.0.1:48933 admin OK QUERY[4] xquery version '3.0'; declare namespace uuid='b1b987d9-3cdb-4ac4-bc83-13bd03eb7a13'; declare option db:queryinfo 'true'; declare variable $uuid:db as xs:string external; declare variable $uuid:uuid as xs:string external; let $step := ( 1 ) return db:optimize($uuid:db, true()) 41.18 ms
21:32:38.727 127.0.0.1:48933 admin REQUEST RESULTS[4]
21:32:38.727 127.0.0.1:48933 admin ERROR Stopped at ., 8/20: [FOUP0002] Database 'stock_stock_work__DOM' is currently opened by another process. 69.73 ms
21:32:38.731 127.0.0.1:48933 admin REQUEST EXIT
21:32:38.739 127.0.0.1:48933 admin OK 8.69 ms
And yet another question:
Is it possible to store the backup-files (CREATE BACKUP) in another
location than the database-directory (e.g. backup-directory)?
Thank's in advance for help
Thomas