transaction isolation level

Started by josh hes.over 19 years ago3 messagesgeneral
Jump to latest
#1josh hes.
jbhester@yahoo.com

We recently updated our postgres to 8.1.4, since then
I�ve been getting the following error:

[Aug 28, 2006 5:43:16 AM ERROR]
org.postgresql.util.PSQLException: Cannot change
transaction isolation level in the middle of a
transaction.
at
org.postgresql.jdbc2.AbstractJdbc2Connection.setTransactionIsolation(AbstractJdbc2Connection.java:729)
at com.evermind._in.setTransactionIsolation(Unknown
Source)
at com.evermind._in.setTransactionIsolation(Unknown
Source)
at com.evermind._in.setTransactionIsolation(Unknown
Source)

Here is an example of the code that does this:

Connection con = null;
try
{
DataSource ds = (DataSource)
ctx.lookup("jdbc/EncounterEJBDS");
con = ds.getConnection();

con.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
.
.
.

Anybody experienced this or have a fix?

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: josh hes. (#1)
Re: transaction isolation level

"josh hes." <jbhester@yahoo.com> writes:

We recently updated our postgres to 8.1.4, since then
I�ve been getting the following error:

[Aug 28, 2006 5:43:16 AM ERROR]
org.postgresql.util.PSQLException: Cannot change
transaction isolation level in the middle of a
transaction.
at
org.postgresql.jdbc2.AbstractJdbc2Connection.setTransactionIsolation(AbstractJdbc2Connection.java:729)

Updated to 8.1.4 from what?

You'll probably have better luck asking on the pgsql-jdbc list (and
mentioning which jdbc driver versions are involved). This looks to me
like it's associated with a change in driver behavior not backend
behavior.

regards, tom lane

#3Dave Cramer
pg@fastcrypt.com
In reply to: Tom Lane (#2)
Re: transaction isolation level

My guess would be that you are getting the connection with autocommit
(false);

Either way try

conn = getConn...
conn.setAutoCommit(false);
conn.changeTransactionLevel

On 29-Aug-06, at 9:15 AM, Tom Lane wrote:

Show quoted text

"josh hes." <jbhester@yahoo.com> writes:

We recently updated our postgres to 8.1.4, since then
I’ve been getting the following error:

[Aug 28, 2006 5:43:16 AM ERROR]
org.postgresql.util.PSQLException: Cannot change
transaction isolation level in the middle of a
transaction.
at
org.postgresql.jdbc2.AbstractJdbc2Connection.setTransactionIsolation(
AbstractJdbc2Connection.java:729)

Updated to 8.1.4 from what?

You'll probably have better luck asking on the pgsql-jdbc list (and
mentioning which jdbc driver versions are involved). This looks to me
like it's associated with a change in driver behavior not backend
behavior.

regards, tom lane

---------------------------(end of
broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings