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