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 ? Machine Learning
avec Scikit-Learn
Voir le programme détaillé
Classe « Session »

Méthode sqlalchemy.orm.Session.begin

Signature de la méthode begin

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

Description

help(Session.begin)

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

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