'Roll back a transaction and reset the dirty flag.'

def rollback(self):

    self.validate_thread_sharing()
    self.validate_no_atomic_block()
    self._rollback()
    self.errors_occurred = False
    self.needs_rollback = False
    self.run_on_commit = []
