jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Guggisberg <stefan.guggisb...@gmail.com>
Subject Re: threading problems
Date Thu, 15 Dec 2005 15:45:10 GMT
hi stephan

On 12/15/05, stephan lohwasser <stephan.lohwasser@systemone.at> wrote:
> hi,
> i have a problem concerning threads and synchronisation and i have not
> the faintest idea how to solve it:
> we're writing a wiki-weblog application based on jackrabbit. now when i
> run a thread importing data from wikipedia with one session while a
> normal user is logged into the system via another session, a
> 'javax.jcr.RepositoryException: Unable to start edit operation: Already
> in edit mode: Already in edit mode' is thrown when the user tries to
> write or read data out of the repository.
> i guess it is a problem of multiple threads working on the same data,
> but i'm not sure.
> is there any synchronisation of sessions working on the repository, or
> do i have to take care of it by myself?
> do you have any hints for me?

jackrabbit should be thread-safe although i can't guarantee that
there aren't still some hidden issues. as long as you don't share
Session objects among multiple threads there shouldn't be any
unexpected issues. if n threads modify the *same* item concurrently
only one thread will succeed and the others will get InvalidItemStateExceptions
informing them that their modifications have become stale.
this is by design. to prevent this you have to lock the node you're
working on.

your problem though seems to be caused by another issue.
please provide a full thread dump and ideally some simple
code to reproduce the problem.


> thanks a lot.
> stephan.

View raw message