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

Mike O'Driscoll modriscoll at clearpathrobotics.com
Fri Jul 17 09:34:15 EDT 2015


Thanks for the quick response Tolga, this immediately solved the issue.

And than you Boris for the technical reasoning, this help me understand the
underlying functionality so to not make similar mistaks.

Cheers,


--
Mike O'Driscoll

On Fri, Jul 17, 2015 at 5:59 AM, Boris Kolpackov <boris at codesynthesis.com>
wrote:

> 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