0 Replies Latest reply on Nov 26, 2007 8:48 AM by adrian.brock

    JBAS-5002 - Tracking XAResource failures

      This is a thread to discuss the tracking of XAResource failures
      (for resource adapters that don't do it themselves).

      Unlike what I put on the original feature request
      http://jira.jboss.com/jira/browse/JBAS-5002
      it would be better implemented as a generic plugin to the TxConnectionManager
      class
      http://jira.jboss.com/jira/browse/JBAS-5003

      i.e. in the pseudo code on JBAS-5002 where it invokes checkFailure(XAException)
      it would really invoke on the connection listener associated with the XAResource
      (not currently implemented in the XAResourceWrapper).

      This would use a singleton checker defined on the TxConnectionManager
      to check for errors

      public interface XAResourceExceptionSorter
      {
       boolean isFatal(XAExecption e);
      ]
      
      TxConnectionManager
      {
       public setXAResourceExceptionSorter(XAResourceExceptionSorter e) { ... }
      }
      


      and configured in the -ds.xml
      <xa-resource-execption-sorter>...</xa-resource-exception-sorter>
      


      The default implementation would check for XAER_RMFAIL and XAER_RMERR
      but there should also be a null implementation (always return false)
      to disable the feature.

      Somebody can then write their own logic to check for other errors
      where the connection should be closed.

      As stated above. The XAResourceWrapper impl also needs changing
      to hold a reference to the ConnectionListener so we know which connection
      we are processing.