Re: Different DataContext

From: Reinout van Schouwen (reinou..mail.com)
Date: Fri Aug 28 2009 - 07:12:26 EDT

  • Next message: Mark Fraser: "relationship has no joins warning"

    Hi John,

    Op woensdag 22-07-2009 om 10:22 uur [tijdzone -0700], schreef John
    Armstrong:

    > This gives me reliable access to a common context for all requests
    > within a thread(request). Its fairly easy to create objects ad hoc and
    > then attach them to the session when your ready to commit. You can
    > also easily detach the object and reattach it when your ready to
    > commit it (and do comparisons etc).

    Could you explain this a bit more? How do you "attach an ad hoc object
    to the session"?

    > Using the ThreadObjectContext() solved all of my context disconnects.

    I'm using Cayenne through Databinder and Databinder.getContext() already
    returns the DataContext.getThreadDataContext(). Still I'm having
    problems with the datacontext. I can copy objects to the local context
    but then Cayenne will complain about temporary id's on commit. It's
    becoming a hear-tearing exercise for me.

    regards,

    -- 
    Reinout van Schouwen
    



    This archive was generated by hypermail 2.0.0 : Fri Aug 28 2009 - 07:14:08 EDT