public void connectionClosed(ConnectionEvent event){
  if (isActive) {
    try {
      XAConnection conn=(XAConnection)event.getSource();
      XAResource xar=(XAResource)xaResourcesMap.get(conn);
      xaResourcesMap.remove(conn);
      Transaction txn=transManager.getTransaction();
      if (txn != null && xar != null)       txn.delistResource(xar,XAResource.TMSUCCESS);
      provider.returnConnection(conn);
    }
 catch (    Exception e) {
      String exception="GemFireTransactionDataSource::connectionClosed: Exception occured due to " + e;
      if (logger.isDebugEnabled()) {
        logger.debug(exception,e);
      }
    }
  }
}

public void connectionClosed ( ConnectionEvent event ) { if ( isActive ) { try { XAConnection conn = ( XAConnection ) event . getSource ( ) ; XAResource xar = ( XAResource ) xaResourcesMap . get ( conn ) ; xaResourcesMap . remove ( conn ) ; Transaction txn = transManager . getTransaction ( ) ; if ( txn != null && xar != null ) txn . delistResource ( xar , XAResource . TMSUCCESS ) ; provider . returnConnection ( conn ) ; } catch ( Exception e ) { String exception = "GemFireTransactionDataSource::connectionClosed: Exception occured due to " + e ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( exception , e ) ; } } } }
implementation of call back function from connectioneventlistener interface . this callback will be invoked on connection close event .
