[Libpqxx-general] Prepared queries - what happens if the connection dies?

Jeroen Vermeulen jtv at xs4all.nl
Thu Oct 29 05:30:53 UTC 2009


Robert Backhaus-pqxx wrote:
> I have been wanting to implement prepared queries in my application, but 
> one question has been preventing me: If you have a stored query, what 
> happens to it if the connection dies and is reconnected by, say, a 
> transactor? Is it gone? If so, how would you recommend restarting it if 
> that happens?

The ongoing execution is interrupted, of course, but the statement will 
be re-defined transparently.  So you can just execute it again 
immediately after.  No need to re-define it.


Jeroen


More information about the Libpqxx-general mailing list