[Libpqxx-general] Connection Pool

Manuel Argüelles manuel.arguelles at gmail.com
Mon Jul 13 18:01:09 UTC 2009


Hello,

I'm looking forward to build a connection pool class, do you know if there's 
any example code or similar that may help me?, if possible I'll like it to be 
multi thread-safe.

If you know of any code or document that can give me some hints about it, I'll 
appreciate it.

So far what I have thought  is to create n lazy connection objects, the 
problem comes in how to know which connection is free (to assign the 
transaction to) and dealing with connection errors.

Or do you think it will be enough to have an static counter of the connections 
and just assign the transactions to the next one (as in a loop)?

Thanks

-- 
Paco





More information about the Libpqxx-general mailing list