From: Ben Weber <bgweber@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Request to check isolation level before throwing exception
Date: Thu, 30 Jul 2009 15:18:44 -0700
Message-ID: <e28334cd0907301518l4255036cj4e9ce960f80f27a9@mail.gmail.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: bgweber@gmail.com
Subject: Re: Request to check isolation level before throwing exception
In-Reply-To: <e28334cd0907301518l4255036cj4e9ce960f80f27a9@mail.gmail.com>
References: <e28334cd0907301518l4255036cj4e9ce960f80f27a9@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox