[odb-users] Problem with session cache and weak_ptr

Boris Kolpackov boris at codesynthesis.com
Tue May 10 19:32:45 EDT 2016

Hi Marcel,

Marcel Nehring <mne at qosmotec.com> writes:

> When persisting new objects my lazy weak pointer referencing them do
> not get updated. If the pointer expires I am unable to reload the
> object since the lazy pointer thinks it points to a transient object.
> Is this expected behavior?

How exactly (and from which state) does your lazy weak pointer
expires? If it was pointing to a persistent object (loaded or
not), unless it is reset, it should still be pointing to a
persistent object. Try also to unload() the expired pointer
before attempting to load() it.


More information about the odb-users mailing list