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 « Connection »

Méthode sqlalchemy.Connection.detach

Signature de la méthode detach

def detach(self) -> 'None' 

Description

help(Connection.detach)

Detach the underlying DB-API connection from its connection pool.

E.g.::

    with engine.connect() as conn:
        conn.detach()
        conn.execute(text("SET search_path TO schema1, schema2"))

        # work with connection

    # connection is fully closed (since we used "with:", can
    # also call .close())

This :class:`_engine.Connection` instance will remain usable.
When closed
(or exited from a context manager context as above),
the DB-API connection will be literally closed and not
returned to its originating pool.

This method can be used to insulate the rest of an application
from a modified state on a connection (such as a transaction
isolation level or similar).



Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé