[odb-users] safe usage odb connection pool in multi threaded environment (odb 2.4.0)

Пустовалов Дмитрий pustovalovdmit at gmail.com
Tue May 2 11:47:06 EDT 2017


I got it!

Thank you very much, Boris.

вт, 2 мая 2017 г. в 16:06, Boris Kolpackov <boris at codesynthesis.com>:

> Hi,
>
> Пустовалов Дмитрий <pustovalovdmit at gmail.com> writes:
>
> > Am I understand right that I should pass odb::database between the
> threads
> > and when I begin transaction on some thread passing to odb::transaction
> > return value from odb::database::begin I ensure that this transaction
> will
> > work on other database connection if needed?
>
> When you call database::begin() it gets the connection from the pool and
> returns it together with the transaction object. Once you finalize the
> transaction (e.g., commit or roll it back, or let it go out of scope in
> which case it is rolled back automatically), then the connection is
> automatically returned back into the pool.
>
> Boris
>


More information about the odb-users mailing list