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

delete referenced objects

Last post 11-21-2007, 04:56 PM by Arne411. 0 replies.
Sort Posts: Previous Next
  •  11-21-2007, 04:56 PM 43749

    delete referenced objects

    Hello

    I need to know how db4o deals with deletet referenced objets. Let's assume an object called MyObject, wich is a direct member of another Object or included in a member set

         class ContainerObject {
             protected MyObject m_myobject = null;
             protected List<MyObject> m_myobject_list = new LinkedList<MyObject>();

            public ContainerObject() {
                 m_myobject = new MyObject();
                 m_myobject_list.add(new MyObject());
            }  
         }

    and the whole ContainerObject was stored in the database (which means the two MyObjects are stored in the same way). If I delete the referenced MyObject in another session, what will be the behavior of db4o.

    1:1 reference : does m_myobject is null ?

    1:n reference : does m_myobject_list.get(0) returns null or does m_myobjectlist_size() returns 0 
                          (if there was only one object in the set)

    Of course I could just check that, but I want to be sure about the formal behavior of db4o (that means I want to rely on it). Thank you, and sorry If I overview some topics of the documentation or if the theme was discussed in another thread

    best regards

    Arne 


    Arne Stocker
View as RSS news feed in XML