MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / close

Method close

lib/sqlalchemy/pool/events.py:320–343  ·  view source on GitHub ↗

Called when a DBAPI connection is closed. The event is emitted before the close occurs. The close of a connection can fail; typically this is because the connection is already closed. If the close operation fails, the connection is discarded. The :meth:`.c

(
        self,
        dbapi_connection: DBAPIConnection,
        connection_record: ConnectionPoolEntry,
    )

Source from the content-addressed store, hash-verified

318 """
319
320 def close(
321 self,
322 dbapi_connection: DBAPIConnection,
323 connection_record: ConnectionPoolEntry,
324 ) -> None:
325 """Called when a DBAPI connection is closed.
326
327 The event is emitted before the close occurs.
328
329 The close of a connection can fail; typically this is because
330 the connection is already closed. If the close operation fails,
331 the connection is discarded.
332
333 The :meth:`.close` event corresponds to a connection that's still
334 associated with the pool. To intercept close events for detached
335 connections use :meth:`.close_detached`.
336
337 :param dbapi_connection: a DBAPI connection.
338 The :attr:`.ConnectionPoolEntry.dbapi_connection` attribute.
339
340 :param connection_record: the :class:`.ConnectionPoolEntry` managing
341 the DBAPI connection.
342
343 """
344
345 def detach(
346 self,

Callers 7

_do_return_connMethod · 0.45
disposeMethod · 0.45
_do_return_connMethod · 0.45
disposeMethod · 0.45
_cleanupMethod · 0.45
disposeMethod · 0.45
disposeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected