From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, mlw <markw(at)mohawksoft(dot)com>, owensmk(at)earthlink(dot)net, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Connection Pooling, a year later |
Date: | 2001-12-18 15:12:57 |
Message-ID: | 200112181512.fBIFCvn12736@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > No problem, it is just that rollbacks when you are not in a transaction
> > cause a log error message.
>
> I don't see any difference in the behavior: you get a notice either way.
>
> regression=# commit;
> NOTICE: COMMIT: no transaction in progress
> COMMIT
> regression=# rollback;
> NOTICE: ROLLBACK: no transaction in progress
> ROLLBACK
> regression=#
>
> My recommendation would generally be to do a ROLLBACK not a COMMIT, on
> the grounds that if the previous user failed to complete his transaction
> you probably want to abort it, not assume that it's safe to commit.
>
> However, this safety-first approach might be unworkable if you have a
> large body of existing code that all assumes it needn't issue COMMIT
> explicitly.
Sorry, I should have said do a "BEGIN;COMMIT;". That only generates an
error message if a transaction was left open, and it commits the
left-open transaction.
We can add a SILENT keyword to COMMIT/ROLLBACK if people really want it.
--
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 | Tom Lane | 2001-12-18 15:27:08 | Re: FreeBSD/alpha |
Previous Message | Tom Lane | 2001-12-18 15:08:43 | Re: Connection Pooling, a year later |