Re: Child context for Web App

From: Pierre Gilquin (pgilqui..luewin.ch)
Date: Sat Mar 22 2008 - 02:59:27 EDT

  • Next message: Razumovsky Andrey: "Re[2]: Child context for Web App"

    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" <hmai..otmail.ru>
    To: <use..ayenne.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



    This archive was generated by hypermail 2.0.0 : Sat Mar 22 2008 - 03:00:21 EDT