cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Frovarp <rfrov...@apache.org>
Subject Re: Multithreaded application trouble with contexts
Date Thu, 17 Nov 2011 18:29:55 GMT
On 11/16/2011 09:15 PM, Robert Zeigler wrote:
> You said "I have that fixed" but you don't say how; also, is the exception you are seeing
now related to the shared URLs?
>
> In any event, you need a call to ObjectContext.localObject to resolve the error you are
seeing.
>
> Robert

I used very heavy synchronization with one ObjectContext with child 
contexts. The exception was related to the shared URLs. I want to 
retrieve the row related to the URL if one already exists, other wise 
create a row and return that.

Using ObjectContext.localObject got me past the different ObjectContext 
problem.

Using Michael's warning about threads sharing contexts, and creating a 
synchonized block to handle adds got me the rest of the way.

So, now everything is working, and I'm not getting any errors or any 
deadlocks.

Thanks Robert and Michael.

Richard

Mime
View raw message