Re: Another exception (Transaction level)
От | Paul Thomas |
---|---|
Тема | Re: Another exception (Transaction level) |
Дата | |
Msg-id | 20030725135228.A21371@bacon обсуждение исходный текст |
Ответ на | Another exception (Transaction level) (Ole Streicher <ole-usenet-spam@gmx.net>) |
Ответы |
Re: Another exception (Transaction level)
|
Список | pgsql-jdbc |
On 25/07/2003 13:09 Ole Streicher wrote: > Hi, > > 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). I think you need to do it before (that's what I deo any I've had a problem) as calling setAutoCommit(false) actually causes the driver to issue a BEGIN; to the back-end to start a transaction. > > BTW, I tried to use TRANSACTION_READ_UNCOMMITTED (which is described > in the manual) but in this case I get "Transaction isolation level 1 > is not supported." > > What is wrong here? Why do I get an error message when I try to use > the "read uncommitted" level, and why I get the exception when I use > commit() after setting the transaction level to "read committed"? > I don't believe that read uncommitted is supported by PostgreSQL. HTH -- Paul Thomas +------------------------------+---------------------------------------------+ | Thomas Micro Systems Limited | Software Solutions for the Smaller Business | | Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk | +------------------------------+---------------------------------------------+
В списке pgsql-jdbc по дате отправления: