[Libpqxx-general] cancellation of synchronous sql statements
Madden, Don (DCOR)
don.madden at smithsdetection.com
Tue Aug 18 17:07:26 UTC 2009
Hi ,
If you execute commands (asynchronously) in a "pipeline", there is a
public method to "cancel()" an ongoing query.
If you execute the SQL commands in a blocking call, you could the
cancel the ongoing command via a signal handler (e.g SIGALRM). lIbpq
supports this via PQcancel(). "libpqxx" doesn't seem to have any
equivalent public method. In the connection_base, the wrapper method,
"cancel_query()" is private. Likewise I couldn't find any public method
to get a raw libpq connection, PGConn in libpqxx's connection_base
classes?
Is there some other way to cancel blocking queries via libpqxx, instead
of using pipelines, e.g a timeout associated with a transaction or the
sql statement? I am limited from using pipelines as I plan to use
cursors through the "stateless_cursor" class whose retrieve() method
executes blocking SQL commands. As a result, I cannot find a way to
cancel a stateless cursor retrieve that may take too long.
Thanks,
Don
************************************************
The information contained in, or attached to, this e-mail, may contain confidential information and is intended solely for the use of the individual or entity to whom they are addressed and may be subject to legal privilege. If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager. Please do not copy it for any purpose, or disclose its contents to any other person. The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company. The recipient should check this e-mail and any attachments for the presence of viruses. The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email.
************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pgfoundry.org/pipermail/libpqxx-general/attachments/20090818/bd7c9f72/attachment.html>
More information about the Libpqxx-general
mailing list