[odb-users] Questions on object_not_persistent exception

Reilly He reillyhekazusa at gmail.com
Mon Oct 30 04:34:00 EDT 2023


Hi Boris,

We recently encountered the '*object_not_persistent*' exceptions when using
odb.
After reading through the manual, especially the chapter:

   - 3.9: Loading Persistent Objects
   - 3.10: Updating Persistent Objects
   - 3.11: Deleting Persistent Objects

We know that we might R/U/D some ORM objects that do not exist in the
database.
But it is really hard to find the detailed biz logic which triggers this
error.

Based on the manual, the exception itself looks like this:

> struct object_not_persistent: exception {
>
> virtual const char*
>
> what () const throw (); };
>

And based on the descriptions on the manual:

> *Catching this exception guarantees that we will catch all the exceptions
> thrown by ODB. The what() function returns a human-readable description of
> the condition that triggered the exception. *


We still find it not enough to quickly detect who triggers the exception.

Do you know how to get more information when this exception happens? *Like
the id, or the operation (R/U/D), or even the type of the Model?*

Thanks a lot.

Best Regards,
Reilly He


More information about the odb-users mailing list