i quickly checked the implementation and i am pretty sure that you are sharing a session among multiple threads. the thread that does the import is most probably using the same session as the other thread that performs the write operations.
cheers stefan On 12/15/05, Stefan Guggisberg <[EMAIL PROTECTED]> wrote: > hi stephan > > On 12/15/05, stephan lohwasser <[EMAIL PROTECTED]> 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. > > cheers > stefan > > > > > thanks a lot. > > stephan. > > > > > > >