AW: [odb-users] Problem with session cache and weak_ptr

Marcel Nehring mne at qosmotec.com
Wed May 11 03:25:19 EDT 2016


Hi Boris,

thanks for your quick response.

What happens is the following:

1) The lazy weak pointer gets initialized to a transient object.
2) The transient object gets persisted.
3) The lazy weak pointer expires.
4) A call to loaded() returns true while a call to get_eager() returns an empty/expired pointer.

According to the manual this means the lazy pointer is a "NULL pointer to transient object".

I guessed that the problem is that the lazy weak pointer does not get informed that the object it points to changed from transient to persisted state.

Regards,
Marcel



More information about the odb-users mailing list