Re: JDBC and transactions

From: Kris Jurka <books(at)ejurka(dot)com>
To: "Chris White (cjwhite)" <cjwhite(at)cisco(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC and transactions
Date: 2005-04-04 17:09:18
Message-ID: Pine.BSO.4.56.0504041206280.2383@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Sun, 3 Apr 2005, Chris White (cjwhite) wrote:

> 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?
>

Well, again that depends on what driver version you are using. 8.0 will
not have started a new transaction yet so one will not be used. For 7.4 a
transaction indeed will be wasted. You could try and be clever and use
setAutoCommit(true) instead of commit() because it will commit your
transaction and not start another, but this would be confusing from a
readability point at least.

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Paul Marchant 2005-04-04 23:04:48 getTransactionIsolation() causes SQLException - unrecognized configuration parameter xactisolevel
Previous Message Kris Jurka 2005-04-04 17:05:17 Re: 8.0.1 performance question.