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)
| 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, |
no test coverage detected