Re: Another exception (Transaction level) - Mailing list pgsql-jdbc

From Ole Streicher
Subject Re: Another exception (Transaction level)
Date
Msg-id 16161.11699.163288.428868@ebp00439.ebp.de
Whole thread Raw
In response to Re: Another exception (Transaction level)  (Paul Thomas <paul@tmsl.demon.co.uk>)
Responses Re: Another exception (Transaction level)  (Paul Thomas <paul@tmsl.demon.co.uk>)
List pgsql-jdbc
Hi Paul,

Paul Thomas writes:
 > > sorry if I flood you with lots of messages, but I am quite new to
 > > Postgresql and I find a lot of questions not answered in the manual.
 > > I get randomly (probably when I have concurrent r/w access) the error
 > > message
 > > java.sql.SQLException: ERROR:  SET TRANSACTION ISOLATION LEVEL must be
 > > called before any query
 > > when I do a commit(). But I had set this level at the very beginning with
 > > dbConn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);

 > Do you do this before or after dbConn.setAutoCommit(false).

Befor. The steps I do are

Connection dbConn;
dbConn = java.sql.DriverManager.getConnection(...);
dbConn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
dbConn.setAutoCommit(false);

and then I use this instance of dbConn for querys and updates (which
may occur concurrently at the same time).

 > > BTW, I tried to use TRANSACTION_READ_UNCOMMITTED (which is described
 > > in the manual)
 > I don't believe that read uncommitted is supported by PostgreSQL.

Finally, I found out the same when searching the net. But, why the
user's manual (9.2. "Transaction Isolation") states something
different? I guess it should be corrected in the manual.

Ciao

Ole

pgsql-jdbc by date:

Previous
From: Paul Thomas
Date:
Subject: Re: Another exception (Transaction level)
Next
From: Paul Thomas
Date:
Subject: Re: Another exception (Transaction level)