summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/functions.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-01-31 11:10:08 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2020-01-31 11:56:21 -0500
commit10b7937bb9994c365436af5e0c1931b2b07d12b1 (patch)
treeaa61dd977f43aef0b868938f720fb2243e2cb3ef /lib/sqlalchemy/sql/functions.py
parent447dec2c15f7b749a3e98df93c001b1b9a36ed32 (diff)
downloadsqlalchemy-10b7937bb9994c365436af5e0c1931b2b07d12b1.tar.gz
Warn for runid changing in load events; add restore_load_context flag
Added a new flag :paramref:`.InstanceEvents.restore_load_context` and :paramref:`.SessionEvents.restore_load_context` which apply to the :meth:`.InstanceEvents.load`, :meth:`.InstanceEvents.refresh`, and :meth:`.SessionEvents.loaded_as_persistent` events, which when set will restore the "load context" of the object after the event hook has been called. This ensures that the object remains within the "loader context" of the load operation that is already ongoing, rather than the object being transferred to a new load context due to refresh operations which may have occurred in the event. A warning is now emitted when this condition occurs, which recommends use of the flag to resolve this case. The flag is "opt-in" so that there is no risk introduced to existing applications. The change additionally adds support for the ``raw=True`` flag to session lifecycle events. Fixes: #5129 Change-Id: I2912f48ac8c5636297d63ed383454930e8e9a6a3
Diffstat (limited to 'lib/sqlalchemy/sql/functions.py')
0 files changed, 0 insertions, 0 deletions