MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _close_impl

Method _close_impl

lib/sqlalchemy/engine/base.py:2687–2701  ·  view source on GitHub ↗
(self, try_deactivate: bool = False)

Source from the content-addressed store, hash-verified

2685 self.connection._commit_impl()
2686
2687 def _close_impl(self, try_deactivate: bool = False) -> None:
2688 try:
2689 if self.is_active:
2690 self._connection_rollback_impl()
2691
2692 if self.connection._nested_transaction:
2693 self.connection._nested_transaction._cancel()
2694 finally:
2695 if self.is_active or try_deactivate:
2696 self._deactivate_from_connection()
2697 if self.connection._transaction is self:
2698 self.connection._transaction = None
2699
2700 assert not self.is_active
2701 assert self.connection._transaction is not self
2702
2703 def _do_close(self) -> None:
2704 self._close_impl()

Callers 2

_do_closeMethod · 0.95
_do_rollbackMethod · 0.95

Calls 3

_cancelMethod · 0.80

Tested by

no test coverage detected