Thanks Andrey,


I am using what you propose for getting child context at session level
chidContext= globalContext.createChildDataContext();. But I dont understand 
your sentence :
it  collapses to just calling one method.

Do you mean using localObject to get object in globalContext ?

objectInGlobalContext = (XXX) 
globalContext.localObject(myObjectInLocalContext.getObjectId(),myObjectInLocalContext);


Thanks again for your help



Pierre


----- Original Message ----- From: "Razumovsky Andrey" <[EMAIL PROTECTED]>
To: <user@cayenne.apache.org>
Sent: Friday, March 21, 2008 11:23 AM
Subject: Re: Child context for Web App


Hi Pierre!

When you use nested contexts (http://cayenne.apache.org/doc/nested-datacontexts.html), you don't need to manually copy objects between contexts, it collapses to just calling one method. I think that's exactly what you need.

Manually calling setObjectContext (and even worse, deprecated setDataContext), by my experience, usually results in errors since Cayenne's internal object graph isn't properly updated.

Andrey

Reply via email to