DB4o update vs insert
Assuming you are using DB4O with the standard configuration and
out-of-the-box - meaning, you are using DB4O's standard internal id
scheme, as per below*.
First, as an assumption, when updating or inserting an object into the
database, the programmer only has one option, to call
"objectContainer.store(object)".
Now, how does DB4O know whether to update an existing object in the DB, or
to insert an entirely new one? My guess is that DB4O looks to see if the
internal id of the object is not null.
However, I could also see the possibility that the burden is on the
programmer to first pull the object from the DB, then update it. So my
question is, how can we reliably update an object in a DB4O database
without first pulling it into Java memory?
*This is very informative:
http://community.versant.com/documentation/Reference/db4o-8.1/java/reference/Content/platform_specific_issues/disconnected_objects/comparison_of_ids.htm
No comments:
Post a Comment