Sun Java Creatror2 postgresql 8.1

Поиск
Список
Период
Сортировка
Искать

Sun Java Creatror2 postgresql 8.1

От:
Владимир Лашин<lash@donenergo.ru>
Дата:
Hi.

Sun Java Studio Creator 2 and PostgreSQL 8.1 database 
using 8.1-405 jdbc3. 

Connectin,fetching,... works.

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".
I must use stored procedures for update and insert records. It works
fine.

When i change the data provider to MySQL 
all works fine (i mean "someDataProvider.commitChanges()").

Can anybody comment ?.

Thanks.


Re: Sun Java Creatror2 postgresql 8.1

От:
Kris Jurka <books@ejurka.com>
Дата:
Вложения:


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
FAQ