Skip site navigation (1) Skip section navigation (2)

Re: Using auto-commit OFF for transactions - instead of BEGIN

From: "David Wall" <d(dot)wall(at)computer(dot)org>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Using auto-commit OFF for transactions - instead of BEGIN
Date: 2004-03-10 01:26:32
Message-ID: 13ab01c4063e$bd380280$3201a8c0@rasta (view raw or flat)
Thread:
Lists: pgsql-jdbc
> I ported a relatively simple application using Oracle 8i with a JDBC
client
> to PostgreSQL 7.4 with the same JDBC client, and everything just worked!

Great.  There must not have been any blobs!  Going the other way often
creates problems because Oracle allows only one LONG field in a table, but
PG allows multiple TEXT fields.  Also, Oracle names are more restrictive and
shorter.

> With Oracle, I was used to setting auto-commit to false at the start of a
> transaction, and then calling commit or rollback at the end.
>
> Is it safe for me to continue setting auto-commit to false for
transactions,
> and are there any compelling reasons - significant performance gains,
> perhaps - why I might want to consider adopting PG's 'BEGIN' statement
> instead?

That should be the way it's done all right.  Turn it off and you can assume
that your connections will be ready with an implicit begin transaction, so
all you have to do is commit/rollback.  After that, an implicit begin occurs
for you.

David


In response to

pgsql-jdbc by date

Next:From: Armando BaƱuelosDate: 2004-03-10 03:08:07
Subject: About using drivers....
Previous:From: Oliver JowettDate: 2004-03-10 00:32:31
Subject: Re: problem with postgres jdbc driver and Java 1.4.2 sdk

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group