logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Re: PQCancel: msg#00013

db.postgresql.lipqxx

Subject: Re: PQCancel

On Fri, August 10, 2007 23:50, Rob Lemley wrote:
> I am interested in adding PQCancel (and friends) support to libpqxx.
>
> I've found one mention of it in the TODO
> (http://pqxx.org/development/libpqxx/changeset/825)
> but it seems to have been removed from the current TODO.
>
> Currently we use PQrequestCancel() to stop long running queries
> when our application server (ie postgresql client) must shutdown.
>
> Before I go further, I was wondering anyone has insights
> about using PQCancel (PQrequestCancel is deprecated),
> and/or implementing a cancel function in libpqxx (presumably
> as a member of the connection_base class).

Interesting idea. A "cancel" option could make sense in three places:

1. In connection_base for multi-threaded programs. This will take some
careful thought about thread synchronization: what happens to
lazyconnections that may be initialized concurrently with the cancel
request, or worse, to asyncconnections? The implementation may have to
figure out whether it's supposed to be canceling a connection attempt or a
query.

2. In pipeline, the only place where arbitrary queries can be executed
asynchronously. Here the worry is semantics: do you set a specific query
to cancel, or just "whatever is going on"?

3. As a timeout option for connection_base::exec()! It may invite more
cancellations than is really healthy, but it'd be a very user-friendly way
to support realtime-ish behaviour. User interaction, for instance, is a
very common realtime task.

And of course there's the matter of transactions. Do you abort the
transaction (if any)? What if you're not currently executing any queries
so that the cancel is a no-op from the database's perspective? Do you
abort, throw, ignore?


Jeroen


<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo