Re: timeout implementation issues

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jessica Perry Hekman <jphekman(at)dynamicdiagrams(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jan Wieck <janwieck(at)yahoo(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: timeout implementation issues
Date: 2002-04-02 19:39:08
Message-ID: 200204021939.g32Jd8R14545@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jessica Perry Hekman wrote:
> On Tue, 2 Apr 2002, Bruce Momjian wrote:
>
> > BEGIN WORK;
> > query;
> > SET statement_timeout = 4;
> > query;
> > SET statement_timeout = 0;
> > query;
> > COMMIT;
> > SET statement_timeout = 0;
> >
> > Basically, it does the reset twice, once assuming the transaction
> > doesn't abort, and another assuming it does abort. Is this something
> > that the JDBC and ODBC drivers can do automatically?
>
> I can't speak for ODBC. Seems like in JDBC, Connection::commit() would
> call code clearing the timeout, and Statement::executeQuery() and
> executeUpdate() would do the same.

Well, then a SET variable would work fine for statement-level queries.
Just add the part for commit/abort transaction.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-04-02 19:59:44 Re: status of IPv6 Support for INET/CIDR types
Previous Message Joe Conway 2002-04-02 19:30:07 Re: Dblink and ISDN