[odb-users] Crash on accessing odb::result object.

Boris Kolpackov boris at codesynthesis.com
Fri Jul 17 05:59:37 EDT 2015


Hi Mike,

Tolga HOŞGÖR <fasdfasdas at gmail.com> writes:

> You cannot operate on result (iterating in this code) after ending the
> transaction.

Yes, Tolga is correct. To expand on this, query result is like
a stream and the database keeps sending the data (rows) as we
iterate over it. And this can clearly only be done while in
transaction. Once the transaction is committed or rolled back,
all results that were created as part of it are invalidated.

Boris



More information about the odb-users mailing list