pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: David Gagnon <dgagnon@siunik.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Is closing a ResulSet, Statement or connection act as
Date: Thu, 21 Apr 2005 11:23:31 +1200
Message-ID: <4266E473.7000103@opencloud.com> (raw)
In-Reply-To: <4266992B.2080901@siunik.com>
References: <Pine.LNX.4.44.0504110519590.13042-200000@ns.surfnonstop.com>
	<4265A05C.6050302@opencloud.com>
	<42667C72.9070708@siunik.com>
	<4266992B.2080901@siunik.com>

David Gagnon wrote:

>  I just wanted to be sure since it's not clear in the
> javadoc that closing a uncomitted resultSet is the samething as issuing
> a rollback prior to closing the ResultSet.

Closing ResultSet objects has no effect on transactions. Closing
Connection objects does.

The PostgreSQL driver implements this behaviour: if autocommit is false,
changes in the current transaction are committed only when you call
Connection.commit() or Connection.setAutoCommit(). So closing the
connection does cause a rollback, since that connection is then dead and
can't be committed.

-O



view thread (2+ messages)

Message-ID: <4266E473.7000103@opencloud.com>
Permalink:  ../4266E473.7000103@opencloud.com/
Also on:    postgresql.org/message-id/4266E473.7000103@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, dgagnon@siunik.com
  Subject: Re: Is closing a ResulSet, Statement or connection act as
  In-Reply-To: <4266E473.7000103@opencloud.com>
  References: <Pine.LNX.4.44.0504110519590.13042-200000@ns.surfnonstop.com> <4265A05C.6050302@opencloud.com> <42667C72.9070708@siunik.com> <4266992B.2080901@siunik.com> <4266E473.7000103@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