Subject [Firebird-Java] New Exception Handling in FBManagedConnection
Author Ken Richard
I believe there is something wrong with exception handling in the
driver. I updated to the latest CVS source and received the following
exception in one of my test cases. The test case is bad and there
should be an error - but I don't think the correct error is being
thrown.

org.firebirdsql.jdbc.FBSQLException: Resource Exception. couldn't commit
local transaction.
Reason: null
at
org.firebirdsql.jdbc.FBConnection.commit(FBConnection.java:460)

I went back to my old version of the driver (cvs 11/5/2002) and ran the
test. I received the following exception with the old version:

java.sql.SQLException: org.firebirdsql.jca.FBResourceException: couldn't
commit local transaction.
Reason: unsuccessful metadata update
object INDEX is in use
at
org.firebirdsql.jdbc.FBConnection.commit(FBConnection.java:458)

It looks like the change is in FBManagedConnection. Here is a snipet of
the code. The error message is inside the GDSException - but it never
gets transferred into the XAException. The original error message is
lost.
try
{
mcf.commit(id);
}
catch (GDSException ge)
{
checkFatalXA(ge, committingDbHandle);
if (log!=null) log.debug("Fatal error committing, ", ge);
throw new XAException(XAException.XAER_RMERR);
}