void registerTranxConnection(XAConnection xaConn) throws Exception {
    try {
      synchronized (this) {
        if (transManager == null) {
          transManager = JNDIInvoker.getTransactionManager();
        }
      }
      Transaction txn = transManager.getTransaction();
      if (txn != null) {
        XAResource xar = xaConn.getXAResource();
        txn.enlistResource(xar);
        // Add in the Map after successful registration of XAResource
        xaResourcesMap.put(xaConn, xar);
      }
    } catch (Exception ex) {
      provider.returnAndExpireConnection(xaConn);
      Exception e = new Exception(
          String.format(
              "GemFireTransactionDataSource-registerTranxConnection(). Exception in registering the XAResource with the Transaction.Exception occurred= %s",
              ex),
          ex);
      throw e;
    }
  }
Implementation of call back function from ConnectionEventListener interface. This callback will
be invoked on connection error event.

@param event Connection event object
geode-core/src/main/java/org/apache/geode/internal/datasource/GemFireTransactionDataSource.java