pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedJDBC transactions
4+ messages / 2 participants
[nested] [flat]
* JDBC transactions
@ 1998-01-07 14:08 Herouth Maoz <herouth@oumail.openu.ac.il>
1998-01-07 16:05 ` Re: JDBC transactions Peter T Mount <pgint@maidast.demon.co.uk>
0 siblings, 1 reply; 4+ messages in thread
From: Herouth Maoz @ 1998-01-07 14:08 UTC (permalink / raw)
To: pgsql-interfaces
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.
Herouth
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: JDBC transactions
1998-01-07 14:08 JDBC transactions Herouth Maoz <herouth@oumail.openu.ac.il>
@ 1998-01-07 16:05 ` Peter T Mount <pgint@maidast.demon.co.uk>
0 siblings, 0 replies; 4+ messages in thread
From: Peter T Mount @ 1998-01-07 16:05 UTC (permalink / raw)
To: Herouth Maoz <herouth@oumail.openu.ac.il>; +Cc: 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@earthling.net or pmount@maidast.demon.co.uk
Main Homepage: http://www.demon.co.uk/finder
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter@maidstone.gov.uk
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: JDBC transactions
@ 1998-01-07 22:40 Herouth Maoz <herouth@oumail.openu.ac.il>
1998-01-08 12:59 ` Re: [INTERFACES] Re: JDBC transactions Peter T Mount <pgint@maidast.demon.co.uk>
0 siblings, 1 reply; 4+ messages in thread
From: Herouth Maoz @ 1998-01-07 22:40 UTC (permalink / raw)
To: pgsql-interfaces
At 18:05 +0200 on 7/1/98, Peter T Mount wrote:
> PS: in the current implementation, con.setAutoCommit(false) itself
> initiates the transaction, not the next sql call.
Ah, good of you to reveal this! This would mean that I would have to call
it again if I want another transaction to start after I've committed the
first.
Herouth
--
Herouth Maoz, B.Sc. Work: herouth@oumail.openu.ac.il
Home: herutma@telem.openu.co.il
HOME PAGE: http://www.cs.bgu.ac.il/~herouth/
Internet technical assistant Open University, Telem Project
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [INTERFACES] Re: JDBC transactions
1998-01-07 22:40 Re: JDBC transactions Herouth Maoz <herouth@oumail.openu.ac.il>
@ 1998-01-08 12:59 ` Peter T Mount <pgint@maidast.demon.co.uk>
0 siblings, 0 replies; 4+ messages in thread
From: Peter T Mount @ 1998-01-08 12:59 UTC (permalink / raw)
To: Herouth Maoz <herouth@oumail.openu.ac.il>; +Cc: pgsql-interfaces
On Thu, 8 Jan 1998, Herouth Maoz wrote:
> At 18:05 +0200 on 7/1/98, Peter T Mount wrote:
>
>
> > PS: in the current implementation, con.setAutoCommit(false) itself
> > initiates the transaction, not the next sql call.
>
> Ah, good of you to reveal this! This would mean that I would have to call
> it again if I want another transaction to start after I've committed the
> first.
Not the case. Once you have setAutoCommit(false), calling commit()
automatically begins a new transaction. The same goes for rollback().
--
Peter T Mount petermount@earthling.net or pmount@maidast.demon.co.uk
Main Homepage: http://www.demon.co.uk/finder
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter@maidstone.gov.uk
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~1998-01-08 12:59 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-01-07 14:08 JDBC transactions Herouth Maoz <herouth@oumail.openu.ac.il>
1998-01-07 16:05 ` Peter T Mount <pgint@maidast.demon.co.uk>
1998-01-07 22:40 Re: JDBC transactions Herouth Maoz <herouth@oumail.openu.ac.il>
1998-01-08 12:59 ` Peter T Mount <pgint@maidast.demon.co.uk>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox