Re: Sun Java Creatror2 postgresql 8.1

From: Kris Jurka <books(at)ejurka(dot)com>
To: Владимир Лашин <lash(at)donenergo(dot)ru>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Sun Java Creatror2 postgresql 8.1
Date: 2006-04-18 06:38:26
Message-ID: Pine.BSO.4.63.0604180120060.21483@leary2.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, 18 Apr 2006, wrote:

> But "someDataProvider.commitChanges()" works only first time.
> Then the only message i get after "someDataProvider.commitChanges()" is
> "can't change isolation level in the middle of transaction".

This is a known issue, please see the archives for the history of it.

I did have a new thought about it today though. Perhaps the application
isn't doing something like:

conn.setAutoCommit(false);
conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
conn.createStatement().execute("SELECT ..");
conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);

but instead is simply resetting the transaction isolation to the current
value. That seems like a poorly coded application, but not one as broken
as trying to actually change the value. The case of setting the
isolation level to the current isolation is really a no-op, so we could
allow that.

The attached patch implements this check although a more complete version
should do some sort of caching of the isolation level to avoid server
calls.

Could you please try out one of the jar files here and report back as to
whether that fixes your problem?

http://www.ejurka.com/pgsql/jars/lash/

Kris Jurka

Attachment Content-Type Size
unchanged-isolation.patch text/plain 977 bytes

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Markus Schaber 2006-04-18 09:58:12 Re: [JDBC] Thoughts on a Isolation/Security problem.
Previous Message Владимир Лашин 2006-04-18 05:30:00 Sun Java Creatror2 postgresql 8.1