Esempio n. 1
0
    def tpc_begin(self, xid):
        if not isinstance(xid, Xid):
            xid = Xid.from_string(xid)

        if self.status != consts.STATUS_READY:
            raise exceptions.ProgrammingError(
                'tpc_begin must be called outside a transaction')

        if self._autocommit:
            raise exceptions.ProgrammingError(
                "tpc_begin can't be called in autocommit mode")

        self._begin_transaction()
        self._tpc_xid = xid
Esempio n. 2
0
    def tpc_begin(self, xid):
        if not isinstance(xid, Xid):
            xid = Xid.from_string(xid)

        if self.status != consts.STATUS_READY:
            raise exceptions.ProgrammingError(
                'tpc_begin must be called outside a transaction')

        if self._autocommit:
            raise exceptions.ProgrammingError(
                "tpc_begin can't be called in autocommit mode")

        self._begin_transaction()
        self._tpc_xid = xid
Esempio n. 3
0
 def tpc_recover(self):
     return Xid.tpc_recover(self)
Esempio n. 4
0
 def xid(self, format_id, gtrid, bqual):
     return Xid(format_id, gtrid, bqual)
Esempio n. 5
0
 def tpc_recover(self):
     return Xid.tpc_recover(self)