/** * Force an immediate rollback, regardless of how many any * CRM_Core_Transaction objects are waiting for * pseudo-commits. * * Only rollback if the transaction API has been called. * * This is only appropriate when it is _certain_ that the * callstack will not wind-down normally -- e.g. before * a call to exit(). */ public static function forceRollbackIfEnabled() { if (self::$_count > 0) { $oldCallbacks = self::$_callbacks; self::$_callbacks = NULL; self::invokeCallbacks(self::PHASE_PRE_ROLLBACK, $oldCallbacks); self::$_dao->query('ROLLBACK'); self::invokeCallbacks(self::PHASE_POST_ROLLBACK, $oldCallbacks); self::$_count = 0; self::$_doCommit = TRUE; } }