Hmm...if your code base can support it easily, I'd say share a session between Reader threads (with try-catch for the InvalidItemStateException added) and instantiate separate sessions for each Editor request.

So yes, I think you're most likely getting that exception because of the non-ACID way you're using sessions.

-Brian



Shaun Barriball wrote:
Thanks for the response Brian.
We're using Spring to setup the Sessions for both the Editor and Reader but
we're not currently associating it with a transaction.
So by your comment "ensure everything that modifies the repository happens
transactionally" is it best to:

 * ensure the "Editor" app associates every update operation in a
transaction to ensure atomicity etc (ACID)

 * ensure the "Reader" app associates the session with a transaction for the
duration of a request which should guarantee a consistent view on JCR and
avoid the InvalidItemStateException otherwise known as the "carpet being
pulled from under you".

So I'm presuming the exception is due to the non-ACID way in which we're
using the repos?

Regards,
Shaun.

Reply via email to