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

Method _trans_ctx_check

lib/sqlalchemy/engine/util.py:107–115  ·  view source on GitHub ↗
(cls, subject: _TConsSubject)

Source from the content-addressed store, hash-verified

105
106 @classmethod
107 def _trans_ctx_check(cls, subject: _TConsSubject) -> None:
108 trans_context = subject._trans_context_manager
109 if trans_context:
110 if not trans_context._transaction_is_active():
111 raise exc.InvalidRequestError(
112 "Can't operate on closed transaction inside context "
113 "manager. Please complete the context manager "
114 "before emitting further commands."
115 )
116
117 def __enter__(self) -> Self:
118 subject = self._get_subject()

Callers 5

_execute_contextMethod · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
_connection_for_bindMethod · 0.80

Calls 1

Tested by

no test coverage detected