Skip site navigation (1) Skip section navigation (2)

Re: Weird behavior in transaction handling (Possible bug ?)

From: Vadim Nasardinov <vadimn(at)redhat(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Weird behavior in transaction handling (Possible bug ?)
Date: 2005-01-14 16:42:54
Message-ID: 200501141142.54170@vadim.nasardinov (view raw or flat)
Thread:
Lists: pgsql-jdbc
On Friday 14 January 2005 11:23, Dave Cramer wrote:
> With postgres once an error occurs in a transaction block you need
> to rollback. None of the transaction will commit.
> 
> This behaviour makes sense as it assumes that the transaction block
> is atomic and it should all succeed or all fail.

For completeness sake, it should be mentioned that Oracle's way of
dealing with this is no less sensible.  Oracle's transactions are
atomic in the sense that all of the statements that did not raise an
error are committed atomically.  If any of the statements fail,
it's up to the application programmer to decide whether or not it
makes sense to continue with the remaining statements.

This question pops up frequently.  Here's a random example:

http://archives.postgresql.org/pgsql-advocacy/2004-03/threads.php#00067

In response to

pgsql-jdbc by date

Next:From: Csaba NagyDate: 2005-01-14 16:57:22
Subject: Re: Weird behavior in transaction handling (Possible bug ?)
Previous:From: j.random.programmerDate: 2005-01-14 16:29:56
Subject: Re: Weird behavior in transaction handling (Possible bug ?) -- commit fails silently

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group