/** * This method makes any changes involved in a transaction permanent and releases any locks held * by the connection object. This is only used when auto-commit is set to false. * * @throws SQLException if the transaction had been rolled back or marked to roll back. */ public void commit() throws SQLException { checkConnection(); if (!autoCommitFlag) { try { directCommit(); } finally { inLocalTxn = false; } } }
public void setAutoCommit(boolean autoCommit) throws SQLException { // Check to see the connection is open checkConnection(); if (autoCommit == this.autoCommitFlag) { return; } this.autoCommitFlag = autoCommit; if (autoCommit) { directCommit(); } else { inLocalTxn = false; } }