/** * Close the cursor and database connection. Make call to cleanupOnClose so sub classes can cleanup * any resources they have allocated. */ @Override protected void doClose() throws Exception { initialized = false; JdbcUtils.closeResultSet(this.rs); rs = null; cleanupOnClose(); if(this.con != null) { this.con.setAutoCommit(this.initialConnectionAutoCommit); } if (useSharedExtendedConnection && dataSource instanceof ExtendedConnectionDataSourceProxy) { ((ExtendedConnectionDataSourceProxy)dataSource).stopCloseSuppression(this.con); if (!TransactionSynchronizationManager.isActualTransactionActive()) { DataSourceUtils.releaseConnection(con, dataSource); } } else { JdbcUtils.closeConnection(this.con); } }
/** * Close the cursor and database connection. Make call to cleanupOnClose so sub classes can cleanup * any resources they have allocated. */ @Override protected void doClose() throws Exception { initialized = false; JdbcUtils.closeResultSet(this.rs); rs = null; cleanupOnClose(); if(this.con != null) { this.con.setAutoCommit(this.initialConnectionAutoCommit); } if (useSharedExtendedConnection && dataSource instanceof ExtendedConnectionDataSourceProxy) { ((ExtendedConnectionDataSourceProxy)dataSource).stopCloseSuppression(this.con); if (!TransactionSynchronizationManager.isActualTransactionActive()) { DataSourceUtils.releaseConnection(con, dataSource); } } else { JdbcUtils.closeConnection(this.con); } }