/** * Close the accessor's connection. * This is used only for external connection pooling * when it is intended for the connection to be reconnected in the future. */ public void closeConnection() { try { if (getDatasourceConnection() != null) { if (isDatasourceConnected()) { closeDatasourceConnection(); } setDatasourceConnection(null); } } catch (DatabaseException exception) { // Ignore setDatasourceConnection(null); } }
/** * Disconnect from the datasource. */ public void disconnect(AbstractSession session) throws DatabaseException { session.log(SessionLog.CONFIG, SessionLog.CONNECTION, "disconnect", (Object[])null, this); if (getDatasourceConnection() == null) { return; } session.incrementProfile(SessionProfiler.TlDisconnects); session.startOperationProfile(SessionProfiler.CONNECT); closeDatasourceConnection(); setDatasourceConnection(null); setIsInTransaction(false); session.endOperationProfile(SessionProfiler.CONNECT); }