From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Thomas Lockhart <lockhart(at)fourpalms(dot)org> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Jessica Perry Hekman <jphekman(at)dynamicdiagrams(dot)com>, Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, Jan Wieck <janwieck(at)yahoo(dot)com>, Barry Lind <barry(at)xythos(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: timeout implementation issues |
Date: | 2002-04-08 16:07:04 |
Message-ID: | 200204081607.g38G74r16401@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Thomas Lockhart wrote:
> > > I consider SET variables metadata that are not affected by transactions.
> > Why? Again, the fact that historically they've not acted that way isn't
> > sufficient reason for me.
>
> Hmm. Historically, SET controls behaviors *out of band* with the normal
> transaction mechanisms. There is strong precedent for this mechanism
> *because it is a useful concept*, not simply because it has always been
> done this way.
OK, probably good time for summarization. First, consider this:
BEGIN WORK;
SET something;
query fails;
SET something else;
COMMIT WORK;
Under current behavior, the first SET is honored, while the second is
ignored because the transaction is in ABORT state. I can see no logical
reason for this behavior. We ignore normal queries during an ABORT
because the transaction can't possibly change any data because it is
aborted, and the previous non-SET statements in the transactions are
rolled back. However, the SET commands are not.
The jdbc timeout issue is this:
BEGIN WORK;
SET query_timeout=20;
query fails;
SET query_timeout=0;
COMMIT WORK;
In this case, with our current code, the first SET is done, but the
second is ignored. To make this work, you would need this:
BEGIN WORK;
SET query_timeout=20;
query fails;
SET query_timeout=0;
COMMIT WORK;
SET query_timeout=0;
which seems kind of strange. The last SET is needed because the query
may abort and the second SET ignored.
> *If* some aspects of SET take on transactional behavior, then this
> should be *in addition to* the current global scope for those commands.
My point is that SET already doesn't have session behavior because it is
ignored if the transaction has already aborted.
--
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
From | Date | Subject | |
---|---|---|---|
Next Message | Fernando Nasser | 2002-04-08 16:09:21 | Re: What's the CURRENT schema ? |
Previous Message | Peter Eisentraut | 2002-04-08 15:56:17 | Re: Debugging symbols by default |