Re: [basex-talk] IllegalMonitorStateException at org.basex.core.locks.DBLocking

2015-04-25 Thread Jens Erat
Hi all, I'd say Simon's proposal to fix the issue pretty much nailed the issue. > One more detail: if in the unsetLockIfUnused() method in the DBLocking > class, I put the locks.remove(object) call in a synchronized(locks){} block, > the problem does not appear any more, but as I don't understand

Re: [basex-talk] IllegalMonitorStateException at org.basex.core.locks.DBLocking

2015-04-22 Thread Simon Chatelain
Hello, Excellent. Glad to be of use. I'll try the new snapshot right away. Cheers Simon On Wed, Apr 22, 2015 at 10:06 AM, Christian Grün wrote: > Hi Simon, > > I finally had time to look at your examples, and... > > > One more detail: [...] > > ...seemed to fix it! The original version of th

Re: [basex-talk] IllegalMonitorStateException at org.basex.core.locks.DBLocking

2015-04-22 Thread Christian Grün
Hi Simon, I finally had time to look at your examples, and... > One more detail: [...] ...seemed to fix it! The original version of this class was written by Jens (in the cc), but I also believe that the basic problem was that the locks instance was not synchronized. In my fix, I used a Concurre

Re: [basex-talk] IllegalMonitorStateException at org.basex.core.locks.DBLocking

2015-04-21 Thread Christian Grün
Thanks for the example. I'm busy right now, but I will give you feedback soon. On Mon, Apr 20, 2015 at 1:44 PM, Simon Chatelain wrote: > > Hello, > > One more detail: if in the unsetLockIfUnused() method in the DBLocking > class, I put the locks.remove(object) call in a synchronized(locks){} blo

Re: [basex-talk] IllegalMonitorStateException at org.basex.core.locks.DBLocking

2015-04-20 Thread Simon Chatelain
Hello, One more detail: if in the unsetLockIfUnused() method in the DBLocking class, I put the locks.remove(object) call in a synchronized(locks){} block, the problem does not appear any more, but as I don't understand exactly what the problem is, I am not sure if it really solves it or if it just

Re: [basex-talk] IllegalMonitorStateException at org.basex.core.locks.DBLocking

2015-04-14 Thread Christian Grün
Simon, I am glad to report the concurrency bug in the user access code has been fixed [1,2]. BaseX 8.1.1 may already be released this week. Of course, please report back to me if you should encounter additional bugs. Thanks for testing, Christian [1] https://github.com/BaseXdb/basex/commit/b5d1

Re: [basex-talk] IllegalMonitorStateException at org.basex.core.locks.DBLocking

2015-04-14 Thread Simon Chatelain
That was fast :-) . Thank you very much. I will test it right away. Regards Simon On Tue, Apr 14, 2015 at 3:28 PM, Christian Grün wrote: > Simon, > > I am glad to report the concurrency bug in the user access code has > been fixed [1,2]. BaseX 8.1.1 may already be released this week. Of > cour

Re: [basex-talk] IllegalMonitorStateException at org.basex.core.locks.DBLocking

2015-04-14 Thread Christian Grün
I have minimized your example a bit (attached), and I agree it seems to be the user iterator that causes surprises. Looking at it.. Christian On Tue, Apr 14, 2015 at 1:48 PM, Christian Grün wrote: > Hi Simon, > > Thanks for the updated code. It's still quite a lot code.. Is all of > it require

Re: [basex-talk] IllegalMonitorStateException at org.basex.core.locks.DBLocking

2015-04-14 Thread Christian Grün
Hi Simon, Thanks for the updated code. It's still quite a lot code.. Is all of it required to reproduce the bug? E.g., does the bug only occur with the specified options etc? Could you possibly reduce it even more? Idealle, we can later rewrite it to a JUnit test once the problem is fixed (and we

Re: [basex-talk] IllegalMonitorStateException at org.basex.core.locks.DBLocking

2015-04-14 Thread Simon Chatelain
Hello Christian, I checked again my code, but I am quite sure that each LocalSession is created and used by only one thread. I attach the test application code. Each LocalSession is used to execute several commands, but that shouldn't be a problem, right ? I also had a look in BaseX code, especi

Re: [basex-talk] IllegalMonitorStateException at org.basex.core.locks.DBLocking

2015-04-13 Thread Christian Grün
> But the java.util.ConcurrentModificationException > at org.basex.core.users.User.find > is still happening. I am pretty sure that any of the concurrent command calls are not moved to their own thread yet. But feel free to pass me on your code (ideally, a version that's as small as possible). B

Re: [basex-talk] IllegalMonitorStateException at org.basex.core.locks.DBLocking

2015-04-13 Thread Simon Chatelain
Hi Christian, Thanks for your answer. I am back in my office only today, and try to implement your recommendation: making sure that every sessions is created and used by only one thread. It seems that the java.lang.IllegalMonitorStateException at org.basex.core.locks.DBLocking.acquire and org.bas

Re: [basex-talk] IllegalMonitorStateException at org.basex.core.locks.DBLocking

2015-04-07 Thread Christian Grün
Hi Simon, Thanks for the detailed description of your setup and your test code. In BaseX, every session needs to be executed in a separate Java thread. The exceptions will e.g. disappear if you pass on your admin session to the store() and updateMetaStore() functions (or if you run these operatio

[basex-talk] IllegalMonitorStateException at org.basex.core.locks.DBLocking

2015-04-02 Thread Simon Chatelain
Hello all, I have the following problem. Using: BaseX 8.1.1 beta cf713e2 (20150328.133759) Java 1.8.0_31 Windows 7 The context: I have several sources of data from which I receive XML documents. My application will create a collection for each of these sources and store each received document i