[odb-users] Exception : "object not persistent" when trying to load object which does not exist in database

Boris Kolpackov boris at codesynthesis.com
Thu Nov 12 10:19:15 EST 2015


Hi Florent,

Florent GRATTA <gratta at visuol.com> writes:

> How can I can avoid avoing an exception?
> 
> std::shared_ptr<Mission> _mission (m_db->load<Mission> (scanexCarId));

Use find() instead of load(). BTW, this is all discussed in the manual.

Boris



More information about the odb-users mailing list