'Prepare this :class:`.TwoPhaseTransaction`.
After a PREPARE, the transaction can be committed.'

def prepare(self):

    if (not self._parent.is_active):
        raise exc.InvalidRequestError('This    transaction    is    inactive')
    self.connection._prepare_twophase_impl(self.xid)
    self._is_prepared = True
