[odb-users] weak pointer gets erased during update

Boris Kolpackov boris at codesynthesis.com
Tue Jul 30 06:49:25 EDT 2013


Hi Jeff,

Jeff Waller <truthset at gmail.com> writes:

> But then I thought that session would save me from worrying about
> that; which goes back to the first statement which you have 
> highlighted.

I am having a really hard time following what you are saying
here since you are talking in terms of function calls that
I have no idea about.

In general, there is no magic in sessions. When an object is
made persistent (via a pointer, not reference), then it is
added to the session. Similarly, when an object is loaded
from the database, it is also added to the session. When
an object is deleted from the database, it is removed from
the session. If you try to load an object that is already
in the session, then that object is returned instead of
creating a new instance.

BTW, this is all described in detail in Section 10.1, "Object
Cache" in the manual.

Boris



More information about the odb-users mailing list