On Tue, 10 Apr 2001, Patrice Espié wrote:
> > > Sure, I want to release it : the other users MUST be free to go away
> instead
> > > of being locked if they try to lock anything already locked
> > A solution I have implemented once is to use an application-side timer
> > to cancel the request after a certain timeout; ugly, but doable. What
> > interface to postgres do you use?
> Doable...
> I use ODBC under Windows, but why not the C or C++ interface ? I will use
> the most efficient (if I can decide which one...)
uhh... I know nothing about Windows, but on Unix and libpq you would
simply use alarm(timeout) to initiate the timer and
sigaction(SIGALRM,...) to install a handler for the timer event which can
in turn call PQrequestCancel; I guess Windows and ODBC can't be too
different, but you better ask someone who knows Windows a bit better
note that the current transaction is in 'aborted' state when you cancel a
request, so you will have to "rollback" and "begin" a new one before
sending any other queries
hope that helps