Re: [Proxool-developer] Closed Connection and Rollback of a transaction
UNMAINTAINED!
Brought to you by:
billhorsman
From: Bill H. <bi...@lo...> - 2007-01-24 19:40:10
|
On 01/24/2007 06:51 PM, Mahendra KC wrote: > I am facing a tricky situation when I am inside a jdbc transaction > and the connection is closed by Proxool because of timeout. As > expected, My method throws an exception and in my catch I normally do > rollback(). Because the connection is closed, as expected, now my > rollback is throwing a null pointer exception. > > My understanding is that there is no standard specified in JDBC > API to determine the transactional behavior when the underlying > connection is closed before commit/rollback. Probably it is more of a > database/driver vendor specific implementation to decide rollback or > commit in the situation where connection is closed. > I am using Oracle 10g, oracle thin driver ( with Hibernate as ORM > layer) and my default in the above scenario happens to be "commit" > instead of "rollback". > > Is there a way in Proxool to intercept connection when it is about to > be automatically closed so that I can rollback before that? The > closest I can find is the onDeath() method from the ConnectionListener > but that method will be always called irrespective of a > natural/unnatural death. > I am hoping there must be a way to get around this common problem. I don't think this is possible, but it should be easy enough to add a new hook for a listener. It seems like a wise thing to do. Are you willing to do some testing of the code in CVS if I make some changes for you? - Bill |