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

Method dispose

lib/sqlalchemy/pool/impl.py:397–408  ·  view source on GitHub ↗

Dispose of this pool.

(self)

Source from the content-addressed store, hash-verified

395 self._all_conns = other_singleton_pool._all_conns
396
397 def dispose(self) -> None:
398 """Dispose of this pool."""
399
400 for conn in self._all_conns:
401 try:
402 conn.close()
403 except Exception:
404 # pysqlite won't even let you close a conn from a thread
405 # that didn't create it
406 pass
407
408 self._all_conns.clear()
409
410 def _cleanup(self) -> None:
411 while len(self._all_conns) >= self.size:

Callers

nothing calls this directly

Calls 2

closeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected