java.nio.channels.OverlappingFileLockException

Sunday, 20 October 2013 · 3 messages · last reply 22 Oct 2013
EN
EV Narasimham20 Oct 2013 22:18 #
Hi, I have 3 application modules. One module, creates the xml database, the second/third module execute queries on the database (no updates are being performed on the database). When the second and the third module try accessing the database, once module is able to query the database while the other module ends up with the below exception. org.basex.core.BaseXException: Improper use? Potential bug? Your feedback is welcome: Contact: basex-talk at mailman.uni-konstanz.de Version: BaseX 7.8 beta Java: Oracle Corporation, 1.7.0_25 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:1017) at org.basex.io.random.TableDiskAccess.lck(TableDiskAccess.java:183) at org.basex.io.random.TableDiskAccess.sharedLock(TableDiskAccess.java:170) at org.basex.io.random.TableDiskAccess.<init>(TableDiskAccess.java:83) at org.basex.data.DiskData.init(DiskData.java:122) at org.basex.data.DiskData.<init>(DiskData.java:92) at org.basex.core.cmd.Open.open(Open.java:68) at org.basex.core.cmd.Open.run(Open.java:35) at org.basex.core.Command.run(Command.java:344) at org.basex.core.Command.exec(Command.java:320) at org.basex.core.Command.execute(Command.java:77) at org.basex.core.Command.execute(Command.java:89) Below are the options being set: context.globalopts.set(GlobalOptions.GLOBALLOCK, false) ; context.globalopts.set(GlobalOptions.PARALLEL, 1) ; //After referring to https://github.com/BaseXdb/basex/issues/574<https://github.com/BaseXdb/basex/issues/574> When the same exercise is being undertaken on a windows machine, the above behavior does not occur. Regards Narasimham <https://github.com/BaseXdb/basex/issues/574>
CG
Christian Grün20 Oct 2013 22:23 #
Hi Narashimham, If you haven’t see it yet, the Wiki page on transactions will give you some insight how locking works in BaseX [1]. Do all of your modules run in the same JVM, and have you ensured that all operations use the same context? If yes, feel free to send us your sample code that demonstrates the problem. Best, Christian [1] http://docs.basex.org/wiki/Transaction_Management ___________________________ 2013/10/20 EV Narasimham <evnarasimham at gmail.com>:
Quoted text · EV Narasimham · 51 lines
> Hi, > I have 3 application modules. One module, creates the xml database, the > second/third module execute queries on the database (no updates are being > performed on the database). > > When the second and the third module try accessing the database, once > module is able to query the database while the other module ends up with the > below exception. > > org.basex.core.BaseXException: Improper use? Potential bug? Your feedback is > welcome: > Contact: basex-talk at mailman.uni-konstanz.de > Version: BaseX 7.8 beta > Java: Oracle Corporation, 1.7.0_25 > 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:1017) > at org.basex.io.random.TableDiskAccess.lck(TableDiskAccess.java:183) > at > org.basex.io.random.TableDiskAccess.sharedLock(TableDiskAccess.java:170) > at > org.basex.io.random.TableDiskAccess.<init>(TableDiskAccess.java:83) > at org.basex.data.DiskData.init(DiskData.java:122) > at org.basex.data.DiskData.<init>(DiskData.java:92) > at org.basex.core.cmd.Open.open(Open.java:68) > at org.basex.core.cmd.Open.run(Open.java:35) > at org.basex.core.Command.run(Command.java:344) > at org.basex.core.Command.exec(Command.java:320) > at org.basex.core.Command.execute(Command.java:77) > at org.basex.core.Command.execute(Command.java:89) > > > Below are the options being set: > context.globalopts.set(GlobalOptions.GLOBALLOCK, false) ; > context.globalopts.set(GlobalOptions.PARALLEL, 1) ; //After referring to > https://github.com/BaseXdb/basex/issues/574 > > When the same exercise is being undertaken on a windows machine, the above > behavior does not occur. > > Regards > Narasimham > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
EN
EV Narasimham22 Oct 2013 00:58 #
Hi Christian, There was an error in my implementation whereby a new context was generated when ever module(s) were loaded during application runtime. After making suitable amendments to the code, the prob. is not to be seen. Regards Narasimham On Sun, Oct 20, 2013 at 10:23 PM, Christian Grün <christian.gruen at gmail.com>wrote:
Quoted text · Christian Grün · 73 lines
> Hi Narashimham, > > If you haven’t see it yet, the Wiki page on transactions will give you > some insight how locking works in BaseX [1]. Do all of your modules > run in the same JVM, and have you ensured that all operations use the > same context? If yes, feel free to send us your sample code that > demonstrates the problem. > > Best, > Christian > > [1] http://docs.basex.org/wiki/Transaction_Management > ___________________________ > > 2013/10/20 EV Narasimham <evnarasimham at gmail.com>: > > Hi, > > I have 3 application modules. One module, creates the xml database, > the > > second/third module execute queries on the database (no updates are being > > performed on the database). > > > > When the second and the third module try accessing the database, once > > module is able to query the database while the other module ends up with > the > > below exception. > > > > org.basex.core.BaseXException: Improper use? Potential bug? Your > feedback is > > welcome: > > Contact: basex-talk at mailman.uni-konstanz.de > > Version: BaseX 7.8 beta > > Java: Oracle Corporation, 1.7.0_25 > > 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:1017) > > at > org.basex.io.random.TableDiskAccess.lck(TableDiskAccess.java:183) > > at > > org.basex.io.random.TableDiskAccess.sharedLock(TableDiskAccess.java:170) > > at > > org.basex.io.random.TableDiskAccess.<init>(TableDiskAccess.java:83) > > at org.basex.data.DiskData.init(DiskData.java:122) > > at org.basex.data.DiskData.<init>(DiskData.java:92) > > at org.basex.core.cmd.Open.open(Open.java:68) > > at org.basex.core.cmd.Open.run(Open.java:35) > > at org.basex.core.Command.run(Command.java:344) > > at org.basex.core.Command.exec(Command.java:320) > > at org.basex.core.Command.execute(Command.java:77) > > at org.basex.core.Command.execute(Command.java:89) > > > > > > Below are the options being set: > > context.globalopts.set(GlobalOptions.GLOBALLOCK, false) ; > > context.globalopts.set(GlobalOptions.PARALLEL, 1) ; //After referring to > > https://github.com/BaseXdb/basex/issues/574 > > > > When the same exercise is being undertaken on a windows machine, the > above > > behavior does not occur. > > > > Regards > > Narasimham > > > > _______________________________________________ > > BaseX-Talk mailing list > > BaseX-Talk at mailman.uni-konstanz.de > > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > > >

⚡Generated with XQuery