Re: JDBC and transactions

Поиск
Список
Период
Сортировка
От Chris White (cjwhite)
Тема Re: JDBC and transactions
Дата
Msg-id 200504032239.j33MdsgS029843@sj-core-3.cisco.com
обсуждение исходный текст
Ответ на Re: JDBC and transactions  (Kris Jurka <books@ejurka.com>)
Ответы Re: JDBC and transactions  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc
So I should setAutoCommit(true) after doing the commit to end the
transaction. But won't this waste a transaction, if the next transaction
starts immediately upon the commit?

Chris

-----Original Message-----
From: Kris Jurka [mailto:books@ejurka.com]
Sent: Friday, April 01, 2005 11:33 PM
To: Chris White (cjwhite)
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] JDBC and transactions



On Fri, 1 Apr 2005, Chris White (cjwhite) wrote:

> 1) When does a transaction start? As soon as I do the first
> insert/update on the connection or as soon as I set autocommit off?
> 2) After doing a commit, when does the next transaction start?

This depends on the driver version you are using.  The 7.4 driver starts a
transaction immediately upon setAutoCommit(false) and starts the next
transaction immediately upon commit.  The 8.0 driver starts the transaction
on the first execution for both the initial and subsequent transactions.

Kris Jurka

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

Предыдущее
От: luke@chipcity.com.au
Дата:
Сообщение: Re: DataSource lookup
Следующее
От: "Nico"
Дата:
Сообщение: Re: DataSource lookup