jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cédric Damioli <cedric.dami...@anyware-tech.com>
Subject Wrong behaviour with session.refresh(true)
Date Thu, 10 Nov 2005 19:59:31 GMT
Hi all,

I'm playing with multi-threaded stuff (SVN trunk from less than 10 

Let suppose that two different threads acquire a Session, then get the 
same Node X and then add a new child to this Node, and then call the 
save() method.

First save() call will success, and second one will lead to : 
b13b8065-5115-4bd3-87cf-5544879209e8: the item cannot be saved because 
it has been modified externally.
The given UUID being the actual UUID of the Node X.
I assume this behaviour is ok, isn't it ?

But, second step, just before calling the method save(), I call 
session.refresh(true), and what I'm getting is not what I was expecting :
firstly, the InvalidItemStateException is here again
and secondly, after debugging, it appears that the refresh(true) doesn't 
behave as expected : after the second call to refresh(true), the second 
Sessions does not know (according to itemExists()) the first child 
created by the first Session.

My code is equivalent to :

Node X = session.getNode(path);

Do I misunderstood the refresh() method ? Or is there a bug here ?


Cédric Damioli
Tel : +33 (0)5 61 00 52 90
Fax : +33 (0)5 61 00 51 46

View raw message