I am trying to figure out what happens by tuning my db4o instance but this is really driving me crazy: it simply does not make sense to me.
Essentially I am creating two objects and store the first in an ArrayList of the second. Then I want to remove the first object both form the whole database and from the list where I have initially stored.
Here is a basic list of the operations I am running.
User user = new User("user");
Device device = new Device("device");
objectContainer.ext().store(user,5); // object storing depth
objectContainer.commit();
objectContainer.delete(device);
//objectContainer.close();
//objectContainer = new ...
At this point if I close and I reopen the objectContainer the user deviceList contains a null object, while if I don't close the container (as a normal running application should normally avoid) the device object is still inside the user object, while it is not in the whole database.
I just want the object to be removed from both the list and from database without any null object in place. Is this possible?? I have tried many tuning the configuration (weakReferences, activations, constraints, ...) a lot but without any success.
Why do you have the object still in the list after reopening, but not before?
db4o won't 'remove' objects for you 'magically' from in memory object. You have to ensure that the object model has a consistent state, like any other in memory object graph.\
Here are some tips: http://community.versant.com/documentation/reference/db4o-8.1/net/reference/Content/best_practises/managing_relations.htm