Re: Using dataobject from a DataContext in other DataContext

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Nov 21 2003 - 14:32:29 EST

  • Next message: Mike Kienenberger: "Re: Using dataobject from a DataContext in other DataContext"

    On Nov 21, 2003, at 3:21 PM, Leonardo R. Nunes wrote:

    > Is that not allowed ? I’m getting my dataObject from one DataContex
    > and trying to delete my dataObject in other DataContext.
    >
    > In the example bellow the delete doesn’t work.

    Correct - DataObject is tied to just one DataContext for its lifecycle,
    thus allowing independent modifications of data by multiple users (each
    DataContext gets its own independent copy of object). If you have a
    reason to transfer objects between DataContexts, use
    DataContext.localObjects() method:

    http://objectstyle.org/cayenne/userguide/datactxt/moving-objects.html
    http://objectstyle.org/cayenne/api/cayenne/org/objectstyle/cayenne/
    access/DataContext.html#localObjects(java.util.List)

    This method is available in Cayenne since version 1.0.3

    Cheers
    Andrus



    This archive was generated by hypermail 2.0.0 : Fri Nov 21 2003 - 14:32:33 EST