You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by "Lemes, Fernando" <fe...@hp.com> on 2015/10/08 16:09:13 UTC

Node access on concurrent sessions.

   Hi guys,

   I'm facing some issues here with multiple sessions accessing the same node. I'm creating a node in a session on a machine and I'm trying to get this node in another session on another machine, but even using a refresh() call I'm failing sometimes. Is this expected? Is there any way to avoid this kind of issue?


   Regards,

Fernando Lemes da Silva
Software Engineer
Brazil R&D



Re: Node access on concurrent sessions.

Posted by Alexander Klimetschek <ak...@adobe.com>.
On 08.10.2015, at 09:30, Clay Ferguson <wc...@gmail.com> wrote:
> 
> I'm not an expert on multiple separate processes/machines, but beware that
> once you open a session it's 'view' of the data will be locked in at that
> point I think

In Oak (Jackrabbit 3) yes.

But in previous Jackrabbit versions up to version 2, anything that the session did not modify itself (in it's transient space, i.e. before calling session.save()) will be an up-to-date view of persisted changes made by other sessions.


Cheers,
Alex

Re: Node access on concurrent sessions.

Posted by Clay Ferguson <wc...@gmail.com>.
I'm not an expert on multiple separate processes/machines, but beware that
once you open a session it's 'view' of the data will be locked in at that
point I think, and even changes made to it will not be visible to other
sessions until you do a session save. Be sure you have everything in some
kind of finally block where your finally ensures to save always, and also
be sure your 'reader' thread is not reusing some old session by accident.
Make sure you are starting with a new session when you are trying to read.
I think sessions should be very 'short lived' just like a transaction on a
RDB or like the Hibernate Session if you know hibernate. Good luck, sorry
if what I just did was state the obvious things you already knew.

Please share your solution with the group, once you find it so others will
know. thanks.


Best regards,
Clay Ferguson
wclayf@gmail.com


On Thu, Oct 8, 2015 at 9:09 AM, Lemes, Fernando <fe...@hp.com>
wrote:

>
>    Hi guys,
>
>    I'm facing some issues here with multiple sessions accessing the same
> node. I'm creating a node in a session on a machine and I'm trying to get
> this node in another session on another machine, but even using a refresh()
> call I'm failing sometimes. Is this expected? Is there any way to avoid
> this kind of issue?
>
>
>    Regards,
>
> Fernando Lemes da Silva
> Software Engineer
> Brazil R&D
>
>
>