Return the current root transaction in progress, if any. .. versionadded:: 1.4
(self)
| 1883 | return self._nested_transaction is not None |
| 1884 | |
| 1885 | def get_transaction(self) -> Optional[SessionTransaction]: |
| 1886 | """Return the current root transaction in progress, if any. |
| 1887 | |
| 1888 | .. versionadded:: 1.4 |
| 1889 | |
| 1890 | """ |
| 1891 | trans = self._transaction |
| 1892 | while trans is not None and trans._parent is not None: |
| 1893 | trans = trans._parent |
| 1894 | return trans |
| 1895 | |
| 1896 | def get_nested_transaction(self) -> Optional[SessionTransaction]: |
| 1897 | """Return the current nested transaction in progress, if any. |
no outgoing calls