Re: JDBC transactions

From: Peter T Mount <pgint(at)maidast(dot)demon(dot)co(dot)uk>
To: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: JDBC transactions
Date: 1998-01-07 16:05:55
Message-ID: Pine.LNX.3.95.980107160033.31816A-100000@maidast
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Wed, 7 Jan 1998, Herouth Maoz wrote:

> I wanted to make sure before I attempt it:
>
> If I'm using the JDBC driver, I don't have to use explicit transaction
> calls. That is, I don't have to sent the statements "BEGIN TRANSACTION" and
> "END".
>
> Instead, I have to do con.setAutoCommit(false), and then, the next SQL call
> will initiate a transaction, which I end by using con.commit() or
> con.rollback().
>
> That's the documented behavior of JDBC, and what I'm asking is whether (a)
> I'm correct in my interpretation, and (b) whether the current JDBC driver
> provided with PostgreSQL 6.2.1 in fact behaves like this.

Briefly looking at the code, this seems to be the case. The autcomit part
of the driver hasn't changed since 6.2, so yes, this is the case.

PS: in the current implementation, con.setAutoCommit(false) itself
initiates the transaction, not the next sql call.

> Herouth

--
Peter T Mount petermount(at)earthling(dot)net or pmount(at)maidast(dot)demon(dot)co(dot)uk
Main Homepage: http://www.demon.co.uk/finder
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter(at)maidstone(dot)gov(dot)uk

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Thorsten Lau 1998-01-07 19:13:47 subscribe
Previous Message Constantin Teodorescu 1998-01-07 14:30:19 Re: [QUESTIONS] pgaccess (libpgtcl) on Solaris?