Re: Select For Update question - Mailing list pgsql-jdbc

From Jean-Christian Imbeault
Subject Re: Select For Update question
Date
Msg-id 3E814C5F.2040102@mega-bucks.co.jp
Whole thread Raw
In response to Select For Update question  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
Responses Re: Select For Update question
List pgsql-jdbc
Barry Lind wrote:
>
> You are running with AutoCommit turned off aren't you?
 > Without autocommit being turned off, the locks will be immediately
> released as soon as the statement autocommits and ends the tranaction.

I am really new to using transactions with JDBC so I did not know about
AutoCommit, I'll look into that. Anything else I should know about when
trying to use transaction? I have been naively doing them as I would on
the psql console, i.e:

stmt.executeQuery("BEGIN");
//many update statements
stmt.executeQuery("COMMIT");

 From what you have written I'm guessing that is *not* the way to go
about it ...

Any pointers to documentation relation to transactions and JDBC welcomed :)

Thanks,

Jean-Christian Imbeault


pgsql-jdbc by date:

Previous
From: Barry Lind
Date:
Subject: Re: Select For Update question
Next
From: Jean-Christian Imbeault
Date:
Subject: Re: jdbc.postgresql.org