Rollback the current transaction in progress. If no transaction is in progress, this method is a pass-through. The method always rolls back the topmost database transaction, discarding any nested transactions that may be in progress. .. seealso::
(self)
| 2017 | return self.begin(nested=True) |
| 2018 | |
| 2019 | def rollback(self) -> None: |
| 2020 | """Rollback the current transaction in progress. |
| 2021 | |
| 2022 | If no transaction is in progress, this method is a pass-through. |
| 2023 | |
| 2024 | The method always rolls back |
| 2025 | the topmost database transaction, discarding any nested |
| 2026 | transactions that may be in progress. |
| 2027 | |
| 2028 | .. seealso:: |
| 2029 | |
| 2030 | :ref:`session_rollback` |
| 2031 | |
| 2032 | :ref:`unitofwork_transaction` |
| 2033 | |
| 2034 | """ |
| 2035 | if self._transaction is None: |
| 2036 | pass |
| 2037 | else: |
| 2038 | self._transaction.rollback(_to_root=True) |
| 2039 | |
| 2040 | def commit(self) -> None: |
| 2041 | """Flush pending changes and commit the current transaction. |
no outgoing calls