Hi Eugeny,

Eugeny N Dzhurinsky wrote:
Right now there is some other errors. I modified
createSession to operate only on single repository (private static Repository
repo). When several threads are working within single session, everything
seems to be ok, but with several sessions there are a lot of exceptions about
 [java] ERROR 20/03/05 05:03:04 [30] (JCRTest$SingleSessionAccessThread:370) - 
javax.jcr.In
validItemStateException: db5e6d2d-6a07-49ac-a2b0-9cfe40d1e9a9/{}test: the item cannot be saved because it has been modified externally.

Because of JCRs data model this can potentially happen to any save() call, unless the modification is protected with a lock.

when one session modifies a node and tries to save it, another session might have been faster and the changes of the latter session win. the first session then gets an InvalidItemStateException because it tried to save inconsistent data.

regards
 marcel

Reply via email to