From: Mike Bayer Date: Sat, 13 May 2023 02:30:40 +0000 (-0400) Subject: qualify session.execute() resulting in autoflush X-Git-Tag: rel_1_4_49~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04380021c8e52787dd327129f3c66e11f737904d;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git qualify session.execute() resulting in autoflush maybe this was planned differently at some point but session.execute() only autoflushes for ORM contexts. Change-Id: Ia10af232248e321875f79d5bde71f64d3dc25177 References: #9776 (cherry picked from commit eb286c15f096771dbb128acbe8fe03e94aa72f6a) --- diff --git a/doc/build/orm/session_basics.rst b/doc/build/orm/session_basics.rst index fcf384d4a2..41390ff0bc 100644 --- a/doc/build/orm/session_basics.rst +++ b/doc/build/orm/session_basics.rst @@ -447,7 +447,9 @@ The flush which occurs automatically within the scope of certain methods is known as **autoflush**. Autoflush is defined as a configurable, automatic flush call which occurs at the beginning of methods including: -* :meth:`_orm.Session.execute` and other SQL-executing methods +* :meth:`_orm.Session.execute` and other SQL-executing methods, when used + against ORM-enabled SQL constructs, such as :func:`_sql.select` objects + that refer to ORM entities and/or ORM-mapped attributes * When a :class:`_query.Query` is invoked to send SQL to the database * Within the :meth:`.Session.merge` method before querying the database * When objects are :ref:`refreshed `