Request to check isolation level before throwing exception - Mailing list pgsql-jdbc

From Ben Weber
Subject Request to check isolation level before throwing exception
Date
Msg-id e28334cd0907301518l4255036cj4e9ce960f80f27a9@mail.gmail.com
Whole thread Raw
List pgsql-jdbc
I am using atomikos 3.5.6. with Postgres 8.4 and have ran into the following problem: Cannot change transaction isolation level in the middle of a transaction. Due to the way that Atomikos manages the Pool of XA connections, I cannot prevent setTransactionIsolation from being called in the middle of transactions. I would like to propose a simple fix for this issue. The setTransactionIsolation method should check the current isolation level before throwing an exception.

Proposed fix in AbstractJdbc2Connection.java:

public void setTransactionIsolation(int level) throws SQLException
{

       // check current level before proceeding
        if (level == getTransactionIsolation()) {
            return;
        }

      ......

}


I have tested this patch in my environment and it fixed the problem. Is it possible to get this change committed to the main build?

Thanks,
Ben Weber

pgsql-jdbc by date:

Previous
From: Ben Weber
Date:
Subject: unnecessary exception patch
Next
From: Thomas Kellerer
Date:
Subject: Datatype of domains not reported correctly.