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

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Is closing a ResulSet, Statement or connection act as
Дата
Msg-id 4266E473.7000103@opencloud.com
обсуждение исходный текст
Ответ на Is closing a ResulSet, Statement or connection act as a rollback when a transaction is not commited? Not clear in JavaDoc.  (David Gagnon <dgagnon@siunik.com>)
Список 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

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: implementing asynchronous notifications
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: JDBC locking on processResults