[odb-users] ODB Reconnect logic
Boris Kolpackov
boris at codesynthesis.com
Wed Mar 30 10:38:11 EDT 2016
Hi Alexandre,
Alexandre Groisman (BLOOMBERG/ 731 LEX) <agroisman3 at bloomberg.net> writes:
> Just wanted to confirm how it works - I found an old message exchange between
> you and another developer in which you mention that you incorporated ping and
> reconnect into connection pool. My question is - if I don't use connection
> pool factory explicitly and rely on odb::database to manage connections for
> me, would I still get that logic? Does it do ping/reconnect prior to every
> transaction?
If you don't specify the connection factory explicitly, then the connection
pool is used by default and, in case of MySQL, with connection ping enabled.
So, yes, provided you don't obtain the connection yourself and then re-use
it for multiple transaction, each transaction will ask the pool for a
connection which will be pinged before being returned.
Boris
More information about the odb-users
mailing list