Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Coder avec une
Intelligence Artificielle
Voir le programme détaillé
Classe « Engine »

Méthode sqlalchemy.Engine.dispose

Signature de la méthode dispose

def dispose(self, close: 'bool' = True) -> 'None' 

Description

help(Engine.dispose)

Dispose of the connection pool used by this
:class:`_engine.Engine`.

A new connection pool is created immediately after the old one has been
disposed. The previous connection pool is disposed either actively, by
closing out all currently checked-in connections in that pool, or
passively, by losing references to it but otherwise not closing any
connections. The latter strategy is more appropriate for an initializer
in a forked Python process.

:param close: if left at its default of ``True``, has the
 effect of fully closing all **currently checked in**
 database connections.  Connections that are still checked out
 will **not** be closed, however they will no longer be associated
 with this :class:`_engine.Engine`,
 so when they are closed individually, eventually the
 :class:`_pool.Pool` which they are associated with will
 be garbage collected and they will be closed out fully, if
 not already closed on checkin.

 If set to ``False``, the previous connection pool is de-referenced,
 and otherwise not touched in any way.

.. versionadded:: 1.4.33  Added the :paramref:`.Engine.dispose.close`
    parameter to allow the replacement of a connection pool in a child
    process without interfering with the connections used by the parent
    process.


.. seealso::

    :ref:`engine_disposal`

    :ref:`pooling_multiprocessing`



Vous êtes un professionnel et vous avez besoin d'une formation ? Machine Learning
avec Scikit-Learn
Voir le programme détaillé