Re: JDBC: "transaction aborted"

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: JDBC: "transaction aborted"
Дата
Msg-id 4C7E0C51.9010708@postnewspapers.com.au
обсуждение исходный текст
Ответ на Re: JDBC: "transaction aborted"  (Fabien JALABERT <fabien.jalabert@laposte.net>)
Список pgsql-jdbc
On 01/09/10 15:40, Fabien JALABERT wrote:
> Hello, if I turn on autocommit, will I be able to process transactions
> with begin/commit/rollback as before ?

If you mean issuing explicit "BEGIN", "COMMIT" and "ROLLBACK" statements
as SQL text through the JDBC driver ... honestly, I'm not sure. It's not
really how the JDBC interface is intended to work.

Typically when using JDBC you would let the driver take care of this.
You call

  conn.setAutoCommit(false);

... to open a transaction. Any work between then and a subsequent:

  conn.commit()

or

  conn.rollback()

is done in the transaction.



--
Craig Ringer

Tech-related writing: http://soapyfrogs.blogspot.com/

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

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: JDBC: "transaction aborted"
Следующее
От: Alessandro Di Bella
Дата:
Сообщение: Bug in implementation of java.sql.DatabaseMetaData