public static Connection enlistConnection(XAConnection xacon) throws GenericTransactionException {
  if (xacon == null) {
    return null;
  }
  try {
    XAResource resource=xacon.getXAResource();
    TransactionUtil.enlistResource(resource);
    return xacon.getConnection();
  }
 catch (  SQLException e) {
    throw new GenericTransactionException("SQL error, could not enlist connection in transaction even though transactions are available",e);
  }
}

public static Connection enlistConnection ( XAConnection xacon ) throws GenericTransactionException { if ( xacon == null ) { return null ; } try { XAResource resource = xacon . getXAResource ( ) ; TransactionUtil . enlistResource ( resource ) ; return xacon . getConnection ( ) ; } catch ( SQLException e ) { throw new GenericTransactionException ( "SQL error, could not enlist connection in transaction even though transactions are available" , e ) ; } }
enlists the given xaconnection and if a transaction is active in the current thread , returns a plain jdbc connection
