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

Re: Is closing a ResulSet, Statement or connection act as

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: David Gagnon <dgagnon(at)siunik(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Is closing a ResulSet, Statement or connection act as
Date: 2005-04-20 23:23:31
Message-ID: 4266E473.7000103@opencloud.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
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

In response to

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2005-04-20 23:24:48
Subject: Re: JDBC locking on processResults
Previous:From: Oliver JowettDate: 2005-04-20 23:15:34
Subject: Re: implementing asynchronous notifications

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