MCPcopy
hub / github.com/psycopg/psycopg / tpc_prepare

Method tpc_prepare

psycopg/psycopg/connection.py:535–543  ·  view source on GitHub ↗

Perform the first phase of a transaction started with `tpc_begin()`.

(self)

Source from the content-addressed store, hash-verified

533 self.wait(self._tpc_begin_gen(xid))
534
535 def tpc_prepare(self) -> None:
536 """
537 Perform the first phase of a transaction started with `tpc_begin()`.
538 """
539 try:
540 with self.lock:
541 self.wait(self._tpc_prepare_gen())
542 except e.ObjectNotInPrerequisiteState as ex:
543 raise e.NotSupportedError(str(ex)) from None
544
545 def tpc_commit(self, xid: Xid | str | None = None) -> None:
546 """

Callers 15

test_tpc_disabledFunction · 0.45
test_tpc_commitMethod · 0.45
test_tpc_rollbackMethod · 0.45
test_xid_encodingMethod · 0.45
test_xid_roundtripMethod · 0.45
test_xid_unicodeMethod · 0.45

Calls 2

waitMethod · 0.95
_tpc_prepare_genMethod · 0.80

Tested by 15

test_tpc_disabledFunction · 0.36
test_tpc_commitMethod · 0.36
test_tpc_rollbackMethod · 0.36
test_xid_encodingMethod · 0.36
test_xid_roundtripMethod · 0.36
test_xid_unicodeMethod · 0.36