[odb-users] Multi-Threaded Environment
Boris Kolpackov
boris at codesynthesis.com
Tue Apr 1 06:11:27 EDT 2014
Hi Shun,
Shun Yu <shunsmailbox at gmail.com> writes:
> Hi, I have a question, what is the proper usage of odb::database in a
> multi-threaded environment?
> Do I need multiple instances of odb::database for simultaneous threads or
> can I just use one instance of odb::database and execute queries using that
> one instance across threads?
Sharing a single instance of odb::database between multiple threads
is the recommended way. By default, it will use the connection pool
and re-use connections for different threads, as required.
Boris
More information about the odb-users
mailing list