Re: Another exception (Transaction level)
От | Ole Streicher |
---|---|
Тема | Re: Another exception (Transaction level) |
Дата | |
Msg-id | 16161.11699.163288.428868@ebp00439.ebp.de обсуждение исходный текст |
Ответ на | Re: Another exception (Transaction level) (Paul Thomas <paul@tmsl.demon.co.uk>) |
Ответы |
Re: Another exception (Transaction level)
|
Список | 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 по дате отправления: