[odb-users] Multi-Threaded Environment

Shun Yu shunsmailbox at gmail.com
Wed Apr 2 12:19:05 EDT 2014


Thanks!


On Tue, Apr 1, 2014 at 3:11 AM, Boris Kolpackov <boris at codesynthesis.com>wrote:

> 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