Re: Another exception (Transaction level)

From: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: Ole Streicher <ole-usenet-08(at)gmx(dot)net>
Cc: "pgsql-jdbc (at) postgresql (dot) org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Another exception (Transaction level)
Date: 2003-07-25 13:57:25
Message-ID: 20030725145725.E21371@bacon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


On 25/07/2003 14:16 Ole Streicher wrote:
> 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).

Concurrently? Do you mean that you a sharing one connection between
several threads? If so then that may be the cause of your problems.

>
> > > 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.

FWIW, the 7.3.3 docs only mention supporting read committed and
serialized. Which version are you using?

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Fernando Nasser 2003-07-25 13:58:17 Re: Another exception (Transaction level)
Previous Message Ole Streicher 2003-07-25 13:16:35 Re: Another exception (Transaction level)