[basex-talk] OverlappingFileLockException error for BaseX version 9.2.4

2020-07-02 Thread Pham Huu Bang
Hello,

I have a Java web application which relies on BaseX library to mostly read
XML files (they are quite big, e.g: 20 MB per file) by XQuery. The XQuery
is also quite complicated. It takes ~3 seconds to query. Configuration file
.basex: https://pastebin.com/3EH7MJi5

I got the error below when multiple requests are processed in parallel.
I wonder how BaseX can work in this case without error like this?

Thanks,

Version: BaseX 9.2.4
Java: Oracle Corporation, 1.8.0_222
OS: Linux, amd64
Stack Trace:
java.nio.channels.OverlappingFileLockException
at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255)
at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152)
at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1107)
at org.basex.io.random.TableDiskAccess.lock(TableDiskAccess.java:147)
at org.basex.io.random.TableDiskAccess.(TableDiskAccess.java:79)
at org.basex.data.DiskData.init(DiskData.java:125)
at org.basex.data.DiskData.(DiskData.java:84)
at org.basex.core.cmd.Open.open(Open.java:99)
at org.basex.core.cmd.Open.run(Open.java:48)
at org.basex.core.Command.run(Command.java:257)
at org.basex.core.Command.execute(Command.java:93)
at org.basex.core.Command.execute(Command.java:116)


Re: [basex-talk] How to set DBPath in BaseX version 8.6.7 as in version 7.3.1?

2018-01-05 Thread Pham Huu, Bang
I've found the answer for it from this page http://docs.basex.org/wiki/Options

so for the java code in version 8.6.7, it needs to use


System.setProperty("org.basex.dbpath", "/home/xxx/test_basex/");

to set this global path and then, BaseX will read/create collection to this 
dbpath correctly.


Bang, Pham Huu
- Research Associate/PhD Student in Computer Science-
Address: Room 96, 2nd Floor, Campus Ring 1, Jacobs University, 28759 Bremen, 
Germany.
Email: b.pham...@jacobs-university.de
Tel: +49 174 7096020
"Your best teacher is your last mistake"


Jacobs University,
Address:
 Campus Ring 1, 28759 Bremen, Germany
Phone:
 +49 421 20040

"Our Focus in research and education"

From: basex-talk-boun...@mailman.uni-konstanz.de 
 on behalf of Bang Pham Huu 

Sent: Friday, January 5, 2018 12:26:01 PM
To: basex-talk@mailman.uni-konstanz.de
Subject: [basex-talk] How to set DBPath in BaseX version 8.6.7 as in version 
7.3.1?

Hello,

I'm using BaseX version 7.3.1 and I can set dbpath where the collections
are created with this code:

new Set("dbpath", "/home//basex-database").execute(context);

However, when changing to BaseX version 8.6.7, this statement will throw
exception "org.basex.core.BaseXException: Global option 'DBPATH' cannot
be set."

and instead it tries to create new collections to a default folder:
/home//BaseXData

How can I set BaseX to work on existing dbpath folder
(/home//basex-database) as in version 7.3.1? Because I have existing
data here and not the newly created one.

Thanks,