MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / prepare

Method prepare

lib/sqlalchemy/orm/session.py:2078–2093  ·  view source on GitHub ↗

Prepare the current transaction in progress for two phase commit. If no transaction is in progress, this method raises an :exc:`~sqlalchemy.exc.InvalidRequestError`. Only root transactions of two phase sessions can be prepared. If the current transaction is not such

(self)

Source from the content-addressed store, hash-verified

2076 trans.commit(_to_root=True)
2077
2078 def prepare(self) -> None:
2079 """Prepare the current transaction in progress for two phase commit.
2080
2081 If no transaction is in progress, this method raises an
2082 :exc:`~sqlalchemy.exc.InvalidRequestError`.
2083
2084 Only root transactions of two phase sessions can be prepared. If the
2085 current transaction is not such, an
2086 :exc:`~sqlalchemy.exc.InvalidRequestError` is raised.
2087
2088 """
2089 trans = self._transaction
2090 if trans is None:
2091 trans = self._autobegin_t()
2092
2093 trans.prepare()
2094
2095 def connection(
2096 self,

Callers 1

_prepare_implMethod · 0.45

Calls 1

_autobegin_tMethod · 0.95

Tested by

no test coverage detected