[odb-users] erase of object in section

Boris Kolpackov boris at codesynthesis.com
Fri Mar 10 05:16:52 EST 2017


Hi Andrew,

Andrew Cunningham <odb at a-cunningham.com> writes:

> #pragma db load(lazy) update(change)
>     mutable odb::section                masssection_;
> #pragma db section(masssection_)
>     std::unique_ptr<CDBFloatMatrix>        massDistribMatrix_;
> 
> Before I erase the "containing" object do I need to load the section to
> ensure the proper erasure  of the massDistribMatrix_ object?

This "containing" terminology is fuzzy. You have a pointer in
massDistribMatrix_ and you have a "pointed-to" object. You can
"erase" the pointer (e.g., by setting it to NULL or to point to
some other object) or you can erase the pointed-to object, or,
perhaps, both. Note also that these two operations are completely
independent (normally; unless you use something like ON DELETE
CASCADE). So what exactly do you want to "erase"?

Boris



More information about the odb-users mailing list