Re: object regsitered in a different DataContext

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Dec 02 2005 - 09:53:03 EST

  • Next message: Andrea Borgogelli Avveduti: "Re: object regsitered in a different DataContext"

    One comment. The solutions below will likely address the exception
    problem. However if the second DataContext creation wasn't
    intentional (I assume it wasn't?), the underlying issue still remains
    unresolved, whatever it might be.

    Andrus

    On Dec 2, 2005, at 5:42 PM, Mike Kienenberger wrote:

    > Another alternative is to do this:
    >
    > persona.getDataContext().deleteObject(persona); // here
    > persona is not null
    > persona.getDataContext().commitChanges();
    >
    > On 12/2/05, Todd O'Bryan <toddobrya..ac.com> wrote:
    >> Basically, persona is from a different DataContext, so
    >> CayenneConnection.dataContext is having trouble deleting it. You
    >> can use
    >>
    >> CayenneConnection.dataContext.localObjects
    >> (Collections.singletonList(persona))
    >>
    >> to get a copy of the object local to this DataContext which it
    >> should be
    >> possible to delete.
    >>
    >> Todd



    This archive was generated by hypermail 2.0.0 : Fri Dec 02 2005 - 09:53:03 EST