Re: Buggy SELEC ... FROM UPDATE ? - Mailing list pgsql-novice

From Helge Bahmann
Subject Re: Buggy SELEC ... FROM UPDATE ?
Date
Msg-id Pine.LNX.4.21.0104101731180.13990-100000@lothlorien.stunet2.tu-freiberg.de
Whole thread Raw
In response to Buggy SELEC ... FROM UPDATE ?  (Patrice Espié <patrice.espie@univ-lyon2.fr>)
List pgsql-novice
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


pgsql-novice by date:

Previous
From: manoj garg
Date:
Subject: how to run postgre on winNT
Next
From: Patrice Espié
Date:
Subject: Re: Buggy SELEC ... FROM UPDATE ?