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 ? Mise en oeuvre d'IHM
avec Qt et PySide6
Voir le programme détaillé
Classe « scoped_session »

Méthode sqlalchemy.orm.scoped_session.begin

Signature de la méthode begin

def begin(self, nested: 'bool' = False) -> 'SessionTransaction' 

Description

help(scoped_session.begin)

Begin a transaction, or nested transaction,
on this :class:`.Session`, if one is not already begun.

.. container:: class_bases

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

The :class:`_orm.Session` object features **autobegin** behavior,
so that normally it is not necessary to call the
:meth:`_orm.Session.begin`
method explicitly. However, it may be used in order to control
the scope of when the transactional state is begun.

When used to begin the outermost transaction, an error is raised
if this :class:`.Session` is already inside of a transaction.

:param nested: if True, begins a SAVEPOINT transaction and is
 equivalent to calling :meth:`~.Session.begin_nested`. For
 documentation on SAVEPOINT transactions, please see
 :ref:`session_begin_nested`.

:return: the :class:`.SessionTransaction` object.  Note that
 :class:`.SessionTransaction`
 acts as a Python context manager, allowing :meth:`.Session.begin`
 to be used in a "with" block.  See :ref:`session_explicit_begin` for
 an example.

.. seealso::

    :ref:`session_autobegin`

    :ref:`unitofwork_transaction`

    :meth:`.Session.begin_nested`





Vous êtes un professionnel et vous avez besoin d'une formation ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé