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

Method _close_impl

lib/sqlalchemy/orm/session.py:2686–2692  ·  view source on GitHub ↗
(self, invalidate: bool, is_reset: bool = False)

Source from the content-addressed store, hash-verified

2684 self._close_impl(invalidate=True)
2685
2686 def _close_impl(self, invalidate: bool, is_reset: bool = False) -> None:
2687 if not is_reset and self._close_state is _SessionCloseState.ACTIVE:
2688 self._close_state = _SessionCloseState.CLOSED
2689 self.expunge_all()
2690 if self._transaction is not None:
2691 for transaction in self._transaction._iterate_self_and_parents():
2692 transaction.close(invalidate)
2693
2694 def expunge_all(self) -> None:
2695 """Remove all object instances from this ``Session``.

Callers 3

closeMethod · 0.95
resetMethod · 0.95
invalidateMethod · 0.95

Calls 3

expunge_allMethod · 0.95
closeMethod · 0.45

Tested by

no test coverage detected