MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _trans_ctx_check

Method _trans_ctx_check

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

Source from the content-addressed store, hash-verified

94
95 @classmethod
96 def _trans_ctx_check(cls, subject: _TConsSubject) -> None:
97 trans_context = subject._trans_context_manager
98 if trans_context:
99 if not trans_context._transaction_is_active():
100 raise exc.InvalidRequestError(
101 "Can't operate on closed transaction inside context "
102 "manager. Please complete the context manager "
103 "before emitting further commands."
104 )
105
106 def __enter__(self) -> Self:
107 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