From 0f5742b94183859d8bf1aa412ae0fcb83affad10 Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Thu, 14 May 2020 16:00:19 -0400 Subject: [PATCH] added docstring about expire_on_commit --- doc/build/errors.rst | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.47.3