summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/session.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-03-01 23:53:58 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-03-01 23:53:58 +0000
commitb84c3b34694f36255e203af5a9d531ff89464bdc (patch)
treec683dc73edbd72f889506f17f678b7d037601fd0 /lib/sqlalchemy/orm/session.py
parent77d6d31542ab2365f218d7305309d6c3468a36dc (diff)
downloadsqlalchemy-b84c3b34694f36255e203af5a9d531ff89464bdc.tar.gz
- The "objects" argument to session.flush() is deprecated.
State which represents the linkage between a parent and child object does not support "flushed" status on one side of the link and not the other, so supporting this operation leads to misleading results. [ticket:1315]
Diffstat (limited to 'lib/sqlalchemy/orm/session.py')
-rw-r--r--lib/sqlalchemy/orm/session.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py
index 1c061c7eb..5e01443a6 100644
--- a/lib/sqlalchemy/orm/session.py
+++ b/lib/sqlalchemy/orm/session.py
@@ -1333,8 +1333,15 @@ class Session(object):
objects
Optional; a list or tuple collection. Restricts the flush operation
to only these objects, rather than all pending changes.
+ Deprecated - this flag prevents the session from properly maintaining
+ accounting among inter-object relations and can cause invalid results.
"""
+
+ if objects:
+ util.warn_deprecated(
+ "The 'objects' argument to session.flush() is deprecated; "
+ "Please do not add objects to the session which should not yet be persisted.")
if self._flushing:
raise sa_exc.InvalidRequestError("Session is already flushing")