Dear Magnolians I'm struggling with something that I thought would be simple:
I have a regular web request response cycle which modifies a node in a JCR workspace. After these modifications are completed, a JMS message is triggered, and the response is displayed to the user. The JMS message does more work (decoupled from the users request-response-loop) and also tries to modify the node again. However this has not worked for me. No matter what I try I keep getting the famose "StaleItemStateException". According to the JCR documentation I found, JCR sessions are not thread safe. Each thread should use it's own session. Magnolia takes care of this for the threads handling the request-response-loops, but what about the independent thread which consumes the JMS messages? How do I need to set things up there in order not to get these annoying exceptions? As a side note: I think the problem only occurs while the session in the request-response-loop thread is still open. The exception occurs the first time the message consumer tries to handle the message. On the retry everything works just fine. So I really think all I would need is an independent JCR session. Any pointers warmly appreciated! Thanks, -will -- Context is everything: http://forum.magnolia-cms.com/forum/thread.html?threadId=b65295a4-5884-4ce1-a2f8-a6f45b000117 ---------------------------------------------------------------- For list details, see http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
