Re: Another exception (Transaction level)

From: Ole Streicher <ole-usenet-spam(at)gmx(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Cc: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
Subject: Re: Another exception (Transaction level)
Date: 2003-07-25 13:16:35
Message-ID: 16161.11699.163288.428868@ebp00439.ebp.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Paul Thomas 2003-07-25 13:57:25 Re: Another exception (Transaction level)
Previous Message Paul Thomas 2003-07-25 12:52:28 Re: Another exception (Transaction level)