db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kathey Marsden <kmarsdende...@sbcglobal.net>
Subject XAException.errorCode on XAException caused by an SQLException
Date Wed, 01 Apr 2009 18:08:15 GMT
When an XAException occurs during xa.start() or other XA operation, 
because of an SQLException, what should the XAException.errorCode be?  
Currently we have an errorCode of 0, regardless of the severity.  Is 
this correct, or should it be XAER_RMERR for SESSION_SEVERITY exceptions 
or all SQLExceptions?

Here is an example where we get no current connection on xa.start() 
after shutting down the database.  (I informed the user that shutting 
down the database in the midst of normal operations is not a good idea 
as it may lead to NullPointerExceptions and other strange behavior on 
other calls). They are, however, wondering about whether we should ever 
see an errorCode 0 on an XAException.

Thanks

Kathey

[C:] java NoConnRepro
connectionClosed called from MyConnectionEventListner
No exception to display
Start shutdown
Shutdown complete
XAException errorCode=0
javax.transaction.xa.XAException: No current connection.
        at 
org.apache.derby.jdbc.EmbedXAResource.wrapInXAException(Unknown Source)
        at org.apache.derby.jdbc.EmbedXAResource.start(Unknown Source)
        at NoConnRepro.main(NoConnRepro.java:33)
Caused by: java.sql.SQLNonTransientConnectionException: No current 
connection.
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown 
Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown 
Source)
        at org.apache.derby.impl.jdbc.Util.noCurrentConnection(Unknown 
Source)
        at 
org.apache.derby.impl.jdbc.EmbedConnection.checkIfClosed(Unknown Source)
        at 
org.apache.derby.impl.jdbc.EmbedConnection.setupContextStack(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.rollback(Unknown 
Source)
        at 
org.apache.derby.jdbc.EmbedPooledConnection.resetRealConnection(Unknown 
Source)
        ... 2 more
Caused by: java.sql.SQLException: No current connection.
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown 
Source)
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown 
Source)
        ... 10 more











Mime
View raw message