MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / soft_invalidate

Method soft_invalidate

lib/sqlalchemy/pool/events.py:292–318  ·  view source on GitHub ↗

Called when a DBAPI connection is to be "soft invalidated". This event is called any time the :meth:`.ConnectionPoolEntry.invalidate` method is invoked with the ``soft`` flag. Soft invalidation refers to when the connection record that tracks this connection

(
        self,
        dbapi_connection: DBAPIConnection,
        connection_record: ConnectionPoolEntry,
        exception: Optional[BaseException],
    )

Source from the content-addressed store, hash-verified

290 """
291
292 def soft_invalidate(
293 self,
294 dbapi_connection: DBAPIConnection,
295 connection_record: ConnectionPoolEntry,
296 exception: Optional[BaseException],
297 ) -> None:
298 """Called when a DBAPI connection is to be "soft invalidated".
299
300 This event is called any time the
301 :meth:`.ConnectionPoolEntry.invalidate`
302 method is invoked with the ``soft`` flag.
303
304 Soft invalidation refers to when the connection record that tracks
305 this connection will force a reconnect after the current connection
306 is checked in. It does not actively close the dbapi_connection
307 at the point at which it is called.
308
309 :param dbapi_connection: a DBAPI connection.
310 The :attr:`.ConnectionPoolEntry.dbapi_connection` attribute.
311
312 :param connection_record: the :class:`.ConnectionPoolEntry` managing
313 the DBAPI connection.
314
315 :param exception: the exception object corresponding to the reason
316 for this invalidation, if any. May be ``None``.
317
318 """
319
320 def close(
321 self,

Callers 1

invalidateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected