MCPcopy
hub / github.com/psycopg/psycopg / tpc_recover

Method tpc_recover

psycopg/psycopg/connection.py:559–569  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

557 self.wait(self._tpc_finish_gen("ROLLBACK", xid))
558
559 def tpc_recover(self) -> list[Xid]:
560 self._check_tpc()
561 status = self.info.transaction_status
562 with self.cursor(row_factory=args_row(Xid._from_record)) as cur:
563 cur.execute(Xid._get_recover_query())
564 res = cur.fetchall()
565
566 if status == IDLE and self.info.transaction_status == INTRANS:
567 self.rollback()
568
569 return res

Callers 15

test_recovered_xidsMethod · 0.45
test_xid_roundtripMethod · 0.45
test_xid_unicodeMethod · 0.45
test_recovered_xidsMethod · 0.45
test_xid_roundtripMethod · 0.45
test_xid_unicodeMethod · 0.45

Calls 7

cursorMethod · 0.95
rollbackMethod · 0.95
args_rowFunction · 0.85
_get_recover_queryMethod · 0.80
_check_tpcMethod · 0.45
executeMethod · 0.45
fetchallMethod · 0.45

Tested by 15

test_recovered_xidsMethod · 0.36
test_xid_roundtripMethod · 0.36
test_xid_unicodeMethod · 0.36
test_recovered_xidsMethod · 0.36
test_xid_roundtripMethod · 0.36
test_xid_unicodeMethod · 0.36