From: jonathan vanasco Date: Thu, 14 May 2020 20:00:19 +0000 (-0400) Subject: added docstring about expire_on_commit X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0f5742b94183859d8bf1aa412ae0fcb83affad10;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git added docstring about expire_on_commit --- diff --git a/doc/build/errors.rst b/doc/build/errors.rst index 599b91e263..6b1b97ebb6 100644 --- a/doc/build/errors.rst +++ b/doc/build/errors.rst @@ -734,6 +734,11 @@ Mitigation of this error is via two general techniques: special directives like the :func:`.raiseload` option can ensure that systems don't call upon lazy loading when its not expected. +Please note: the default setting of :paramref:`_sa.orm.session.Session.expire_on_commit` +is `True`, which means SQLAlchemy will expire the instance and all loaded +attributes when a `commit` occurs. When this happens, SQLAlchemy will need to +query the database to refresh the instance and attributes. + .. seealso:: :ref:`loading_toplevel` - detailed documentation on eager loading and other