/** * Undo all operations back to the log position of the given savepoint. * * @param name the savepoint name */ public void rollbackToSavepoint(String name) { checkCommitRollback(); if (savepoints == null) { throw DbException.get(ErrorCode.SAVEPOINT_IS_INVALID_1, name); } Integer savepointIndex = savepoints.get(name); if (savepointIndex == null) { throw DbException.get(ErrorCode.SAVEPOINT_IS_INVALID_1, name); } int i = savepointIndex.intValue(); rollbackTo(i, false); }
/** Fully roll back the current transaction. */ public void rollback() { checkCommitRollback(); currentTransactionName = null; boolean needCommit = false; if (undoLog.size() > 0) { rollbackTo(0, false); needCommit = true; } if (locks.size() > 0 || needCommit) { database.commit(this); } cleanTempTables(false); unlockAll(); if (autoCommitAtTransactionEnd) { autoCommit = true; autoCommitAtTransactionEnd = false; } }