/** * Rollbacks the micro-transaction after failed commit attempt. */ public void rollbackAfterFailedCommit() { if (active) throw error("Active micro-transaction on rollback after failed commit"); if (level != 0) throw error("Unbalanced micro-transaction, level = " + level); doRollback(); }
/** * Rollbacks the micro-transaction if it's a top-level micro-transaction. */ public void rollback() { if (!active) throw error("Inactive micro-transaction on rollback"); if (level < 1) throw error("Unbalanced micro-transaction, level = " + level); --level; if (level == 0) { active = false; doRollback(); } }