public void close() throws SQLException { Throwable firstException = null; if(closed) { return; } try { // close any statements that were created on this connection try { closeStatements(); } catch (SQLException se) { firstException = se; } finally { this.serverConn.close(); if ( firstException != null ) throw (SQLException)firstException; } } catch (SQLException se) { throw TeiidSQLException.create(se, JDBCPlugin.Util.getString("MMConnection.Err_connection_close", se.getMessage())); //$NON-NLS-1$ } finally { logger.fine(JDBCPlugin.Util.getString("MMConnection.Connection_close_success")); //$NON-NLS-1$ // set the status of the connection to closed closed = true; } }
public void close() throws SQLException { Throwable firstException = null; if(closed) { return; } try { // close any statements that were created on this connection try { closeStatements(); } catch (SQLException se) { firstException = se; } finally { this.serverConn.close(); if ( firstException != null ) throw (SQLException)firstException; } } catch (SQLException se) { throw TeiidSQLException.create(se, JDBCPlugin.Util.getString("MMConnection.Err_connection_close", se.getMessage())); //$NON-NLS-1$ } finally { logger.fine(JDBCPlugin.Util.getString("MMConnection.Connection_close_success")); //$NON-NLS-1$ // set the status of the connection to closed closed = true; } }
public void recycleConnection() { this.payload = null; try { //close all open statements this.closeStatements(); } catch (SQLException e) { logger.log(Level.WARNING, JDBCPlugin.Util.getString("MMXAConnection.rolling_back_error"), e); //$NON-NLS-1$ } try { //rollback if still in a transaction if (!this.getAutoCommit()) { logger.warning(JDBCPlugin.Util.getString("MMXAConnection.rolling_back")); //$NON-NLS-1$ if (this.getTransactionXid() == null) { this.rollback(false); } else { this.rollbackTransaction(getTransactionXid()); } } } catch (SQLException e) { logger.log(Level.WARNING, JDBCPlugin.Util.getString("MMXAConnection.rolling_back_error"), e); //$NON-NLS-1$ } }
public void recycleConnection() { this.payload = null; try { //close all open statements this.closeStatements(); } catch (SQLException e) { logger.log(Level.WARNING, JDBCPlugin.Util.getString("MMXAConnection.rolling_back_error"), e); //$NON-NLS-1$ } try { //rollback if still in a transaction if (!this.getAutoCommit()) { logger.warning(JDBCPlugin.Util.getString("MMXAConnection.rolling_back")); //$NON-NLS-1$ if (this.getTransactionXid() == null) { this.rollback(false); } else { this.rollbackTransaction(getTransactionXid()); } } } catch (SQLException e) { logger.log(Level.WARNING, JDBCPlugin.Util.getString("MMXAConnection.rolling_back_error"), e); //$NON-NLS-1$ } }