'Commit this :class:`.Transaction`.'

def commit(self):

    if (not self._parent.is_active):
        raise exc.InvalidRequestError('This    transaction    is    inactive')
    self._do_commit()
    self.is_active = False
