Transaction rollback logic.