Re: Weird behavior in transaction handling (Possible bug ?) -- commit fails silently

From: "j(dot)random(dot)programmer" <javadesigner(at)yahoo(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Weird behavior in transaction handling (Possible bug ?) -- commit fails silently
Date: 2005-01-14 23:01:42
Message-ID: 20050114230142.69954.qmail@web14201.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi:

> fail. A subsequent
> COMMIT will not actually commit; it will roll back.
> ...snip...
> it has been for ages. Don't ignore errors from your
> queries!

ok !

> It might be worthwhile having commit() throw an
> exception if the
> transaction did not actually commit, rather than
> only reporting
> server-generated errors. What do people think?

Yup. But if that's too much of a dirty hack, then an
alternative
is to put the current behavior in the JDBC FAQ section
located
at:

http://jdbc.postgresql.org/documentation/faq.html

>
> 7.4 returns COMMIT for rolled-back COMMITs, but does
> report transactions
> that have failed via the v3 protocol. 8.0 returns
> ROLLBACK for
> rolled-back COMMITs and also uses the v3 protocol.
> So it should be
> possible to detect this case for both 7.4 and 8.0
> reasonably easily.

Cool, then maybe the 8.x driver should do so. And the
current
driver's (or actually the postgres database's)
behavior can
be described in the FAQ ? I think that would be _very_
useful
for newbies who might otherwise be bit by this
behavior and/or
post the same question again and again to the mailing
list.

> Also in 8.0 and later, there is savepoint support
> that helps with this
> case. The pattern to use is something like this:
> [....snip lots of info...]

Thanks for that additional info.

Best regards,

--j


__________________________________
Do you Yahoo!?
The all-new My Yahoo! - What will yours do?
http://my.yahoo.com

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2005-01-14 23:44:53 Re: Weird behavior in transaction handling (Possible bug ?)
Previous Message Vadim Nasardinov 2005-01-14 22:27:02 Re: Weird behavior in transaction handling (Possible bug ?)