Unix Technical Forum

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

This is a discussion on Re: Weird behavior in transaction handling (Possible bug ?) -- commit fails silently within the pgsql Interfaces jdbc forums, part of the PostgreSQL category; --> Hi: > fail. A subsequent > COMMIT will not actually commit; it will roll back. > ...snip... > it ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces jdbc

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-15-2008, 10:58 PM
j.random.programmer
 
Posts: n/a
Default Re: Weird behavior in transaction handling (Possible bug ?) -- commit fails silently

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

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:46 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com