pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Weird behavior in transaction handling (Possible bug ?)
Date: Sat, 15 Jan 2005 20:27:45 +1300
Message-ID: <41E8C5F1.1030800@opencloud.com> (raw)
In-Reply-To: <27168.1105746293@sss.pgh.pa.us>
References: <20050114161304.32600.qmail@web14223.mail.yahoo.com>
	<41E83BE1.2020909@opencloud.com>
	<200501141707.38043@vadim.nasardinov>
	<27168.1105746293@sss.pgh.pa.us>

Tom Lane wrote:
> Vadim Nasardinov <vadimn@redhat.com> writes:
> 
>>On Friday 14 January 2005 16:38, Oliver Jowett wrote:
>>
>>>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?
> 
> 
>>Sounds like a good idea.
> 
> 
> Doesn't the JDBC spec have anything to say about what this should do?

The JDBC spec is vague as usual.

The Connection.commit() javadoc says:

===

     Makes all changes made since the previous commit/rollback permanent 
and releases any database locks currently held by this Connection 
object. This method should be used only when auto-commit mode has been 
disabled.

     Throws:
         SQLException - if a database access error occurs or this 
Connection object is in auto-commit mode

===

What counts as a "database access error"? We currently throw on 
communication errors or server-generated errors only. A previous error 
causing transaction rollback doesn't seem like an access error really, 
but given that you can get other errors thrown when the transaction does 
not commit for other reasons, I'm not sure why that case should be 
different.

-O



view thread (22+ messages)  latest in thread

Message-ID: <41E8C5F1.1030800@opencloud.com>
Permalink:  ../41E8C5F1.1030800@opencloud.com/
Also on:    postgresql.org/message-id/41E8C5F1.1030800@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, tgl@sss.pgh.pa.us
  Subject: Re: Weird behavior in transaction handling (Possible bug ?)
  In-Reply-To: <41E8C5F1.1030800@opencloud.com>
  References: <20050114161304.32600.qmail@web14223.mail.yahoo.com> <41E83BE1.2020909@opencloud.com> <200501141707.38043@vadim.nasardinov> <27168.1105746293@sss.pgh.pa.us> <41E8C5F1.1030800@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox