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 ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé
Classe « scoped_session »

Méthode sqlalchemy.orm.scoped_session.expire_all

Signature de la méthode expire_all

def expire_all(self) -> 'None' 

Description

help(scoped_session.expire_all)

Expires all persistent instances within this Session.

.. container:: class_bases

    Proxied for the :class:`_orm.Session` class on
    behalf of the :class:`_orm.scoping.scoped_session` class.

When any attributes on a persistent instance is next accessed,
a query will be issued using the
:class:`.Session` object's current transactional context in order to
load all expired attributes for the given instance.   Note that
a highly isolated transaction will return the same values as were
previously read in that same transaction, regardless of changes
in database state outside of that transaction.

To expire individual objects and individual attributes
on those objects, use :meth:`Session.expire`.

The :class:`.Session` object's default behavior is to
expire all state whenever the :meth:`Session.rollback`
or :meth:`Session.commit` methods are called, so that new
state can be loaded for the new transaction.   For this reason,
calling :meth:`Session.expire_all` is not usually needed,
assuming the transaction is isolated.

.. seealso::

    :ref:`session_expire` - introductory material

    :meth:`.Session.expire`

    :meth:`.Session.refresh`

    :meth:`_orm.Query.populate_existing`




Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les compléments
Voir le programme détaillé