private void disconnect(boolean finalize){
  if (isDiscarded() && connection == null) {
    return;
  }
  setDiscarded(true);
  if (connection != null) {
    try {
      parent.disconnectEvent(this,finalize);
      if (xaConnection == null) {
        connection.close();
      }
 else {
        xaConnection.close();
      }
    }
 catch (    Exception ignore) {
      if (log.isDebugEnabled()) {
        log.debug("Unable to close underlying SQL connection",ignore);
      }
    }
  }
  connection=null;
  xaConnection=null;
  lastConnected=-1;
  if (finalize)   parent.finalize(this);
}

private void disconnect ( boolean finalize ) { if ( isDiscarded ( ) && connection == null ) { return ; } setDiscarded ( true ) ; if ( connection != null ) { try { parent . disconnectEvent ( this , finalize ) ; if ( xaConnection == null ) { connection . close ( ) ; } else { xaConnection . close ( ) ; } } catch ( Exception ignore ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Unable to close underlying SQL connection" , ignore ) ; } } } connection = null ; xaConnection = null ; lastConnected = - 1 ; if ( finalize ) parent . finalize ( this ) ; }
disconnects the connection . all exceptions are logged using debug level .
