]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
qualify session.execute() resulting in autoflush
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 13 May 2023 02:30:40 +0000 (22:30 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 13 May 2023 02:31:34 +0000 (22:31 -0400)
maybe this was planned differently at some point but
session.execute() only autoflushes for ORM contexts.

Change-Id: Ia10af232248e321875f79d5bde71f64d3dc25177
References: #9776

doc/build/orm/session_basics.rst

index 12413336a06f24dfea480c8a3c6968a198849881..33a58e87c7fc0e8a571da4895d37d0321fa6ad67 100644 (file)
@@ -386,7 +386,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 <session_expiring>`