[odb-users] polymorphic inheritance, typeid, odb::object_not_persistent

Boris Kolpackov boris at codesynthesis.com
Wed Jul 22 10:43:46 EDT 2015


MM <finjulhich at gmail.com> writes:

> Within the same transaction, I do successfully load 11(all) of the
> 'sometype':
> I get raw pointers from the load() calls (same as above), and I own these
> pointers with a boost::ptr_vector.
> _After_ the 'sometype' are loaded, I, then, load the Base items. But that
> fails.

What if you try to load D1..D10 using load() rather than query(),
specifying either Base or the concrete types (both should work).
This way you can narrow it down to which one fails to load (if
any; it can also be that load() will work and there is something
special about query()).

> Am I breaking the relationship for odb to connect the dots somehow?

Not that I can see.

> Is there some sort of debugging I can trigger to detect the issue?

Yes, in fact, enabling statement tracing in such situations can be
very helpful. Try:

t.tracer (stderr_tracer);

This way we will at least know where exactly things go south.


More information about the odb-users mailing list