MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / get_transaction

Method get_transaction

lib/sqlalchemy/orm/session.py:1844–1853  ·  view source on GitHub ↗

Return the current root transaction in progress, if any. .. versionadded:: 1.4

(self)

Source from the content-addressed store, hash-verified

1842 return self._nested_transaction is not None
1843
1844 def get_transaction(self) -> Optional[SessionTransaction]:
1845 """Return the current root transaction in progress, if any.
1846
1847 .. versionadded:: 1.4
1848
1849 """
1850 trans = self._transaction
1851 while trans is not None and trans._parent is not None:
1852 trans = trans._parent
1853 return trans
1854
1855 def get_nested_transaction(self) -> Optional[SessionTransaction]:
1856 """Return the current nested transaction in progress, if any.

Callers 15

test_bound_connectionMethod · 0.95
provide_metadataFunction · 0.45
metadataMethod · 0.45
goFunction · 0.45
test_get_transactionMethod · 0.45
test_get_transactionMethod · 0.45

Calls

no outgoing calls