'Roll back any ongoing transaction and clean the transaction state
stack.'

def abort(self):

    if self._dirty:
        self.rollback()
    while self.transaction_state:
        self.leave_transaction_management()
