MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / get_transaction

Method get_transaction

lib/sqlalchemy/orm/session.py:1885–1894  ·  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

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.

Callers 15

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

Calls

no outgoing calls