[Libpqxx-general] Lazy Connection

Jeroen Vermeulen jtv at xs4all.nl
Wed Oct 28 06:14:43 UTC 2009


Mark Gabriel Paylaga wrote:

> If I use a Lazy Connection, it only connects to the DB when i do a new 
> transaction right (like do some select etc..)?

That's right.  Or if you're using a nontransaction, it'll connect when 
you start executing queries.


> If that transaction is done, would it disconnect from the DB and then 
> reconnect again when another transaction is started?

No.  If that's what you want, you can use deactivate().  The idea of a 
lazy connection is that you can open lots of connections but not "pay" 
for the ones you don't use.


Jeroen


More information about the Libpqxx-general mailing list