Subject Re: [Firebird-Java] reuse of connection after failure.
Author Andrew Goedhart

Looks like the patch only sort of worked

Basically we fail trying to recover/roll back an in limbo transaction.

The temporary connection made during FbManagedConnection.tryCompleteInLimboTransaction() throws an exception when closed saying it still has an 1 active transaction on being closed. This results in the connection becoming unusable because this is not fatal and when JBoss tries to start a new connection it dies with a XA_UNKNOWN(0) error because the connection already has an active transaction. I am guessing about this because the stack trace is not existent, past the start() method. The code was not chaining the GDS exception. I have changed this and am attempting to see what happens. Jboss keeps on supplying the connection to jobs and keeps on failing on starting a new transaction.

I am currently forcing a fatal error in FBManagedConnection.start() when it cannot start a transaction to try and force jboss to discard the connection. I will run this tonight and see if it helps. I guess that Jboss's transaction manager should discard a connection it cannot create a transaction on, But I am hoping that the XA_UNKNOWN(0) error code may be confusing it.

Any thoughts on this.

I also noticed that are a number of places in with managed connections where we throw isc_network errors which are now fatal but because the function is called via the Managed connection rather then GDSHelper we do not notify anyone that the connection is potentially dead. I am wondering if this is likely to be a problem. Specifically in areas where we try and recover transaction. In this area we are using GDS_java_impl directly.