jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torgeir Veimo <torg...@pobox.com>
Subject Re: "Unable to lock node. Node has pending changes: /counter"
Date Tue, 20 Jun 2006 09:46:54 GMT
On Tue, 2006-06-20 at 09:21 +0100, Torgeir Veimo wrote:
> On Mon, 2006-06-19 at 16:56 +0200, Marcel Reutegger wrote:
> > On 6/19/06, Torgeir Veimo <torgeir@pobox.com> wrote:
> > > Would it be correct to call refresh(false) on the counter node in case
> > > of an exception? I only ever modify the value property when the node is
> > > created and in the generateNewResourceId() method.
> > 
> > yes, you should definitively handle that case. but after having a
> > second look at your code I realized that the counter node actually
> > doesn't get modified in the run method. It is only the property that
> > changes. So it seems there must be some code that modifies the counter
> > node outside of the Locked.run() method.
> > 
> > there are also some test cases that show how to use the utility:
> > http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/LockTest.java
> > 
> > Those test cases run fine on my checkout. and one of them
> > (LockTest.testSequence) does the same as your generateNewResourceId()
> > method, it increments a counter property.
> 
> I copy&pasted that code into mine, and run the testSequence code on am
> empty repository. I made some slight changes, and now that code gives
> the same exceptions. Notice how I changed retrieving the session and the
> lack of session logout. 

I can confirm that if my getNewResourceId() uses it's own session that
it closes after retrieving the counter value, it works. The lock code
should ideally work with the samme session being reused?


-- 
Torgeir Veimo <torgeir@pobox.com>


Mime
View raw message