db4o Developer Community

db4o open source object database, native to Java and .NET
Welcome to db4o Developer Community Sign in | Join
in Search
More Search Options

Detaching objects

Last post 01-24-2006, 05:52 PM by jleotta. 2 replies.
Sort Posts: Previous Next
  •  01-24-2006, 04:37 PM 22041

    Detaching objects

    Hello all,

    Is there a way to detach or clone an object retrieved from the db and reattach it back?

    This was a question asked of me after requesting a doNotSave method be added to the Eclipse editor interface.  Databinding frameworks update the model before a user commits the changed object. 
    When the user selects 'No' to the save dialog there is no easy method to refresh the object from the db since it is cached in a viewer of some type.  If interested: https://bugs.eclipse.org/bugs/show_bug.cgi?id=122260

  •  01-24-2006, 04:47 PM 22042 in reply to 22041

    Re: Detaching objects

    Yes.

    Please look into:

    ExtObjectContainer#purge(object);

    ExtObjectContainer#getID(object);

    ExtObjectContainer#bind(object, id)

     

    To get a transient clone of a persisted object, you can also use:

    ExtObjectContainer#peekPersisted(object, depth, committed);

     

  •  01-24-2006, 05:52 PM 22043 in reply to 22042

    Re: Detaching objects

    Thanks Carl.  I will give this a test.  Once again, this is the coolest db anywhere!
View as RSS news feed in XML