Re: Weird behavior in transaction handling (Possible bug ?) -- commit fails silently
От | j.random.programmer |
---|---|
Тема | Re: Weird behavior in transaction handling (Possible bug ?) -- commit fails silently |
Дата | |
Msg-id | 20050114230142.69954.qmail@web14201.mail.yahoo.com обсуждение исходный текст |
Ответ на | Re: Weird behavior in transaction handling (Possible bug ?) (Oliver Jowett <oliver@opencloud.com>) |
Список | 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
В списке pgsql-jdbc по дате отправления: