From: Mike Bayer Date: Thu, 8 Jan 2009 15:33:34 +0000 (+0000) Subject: query.delete(False) is not so bad X-Git-Tag: rel_0_5_1~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e9f787f9fee4f77aa862d5d209f6c840079c6f3c;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git query.delete(False) is not so bad --- diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index c5349e052e..03030f8b04 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -1335,10 +1335,11 @@ class Query(object): session. Valid values are: False - don't synchronize the session. Use this when you don't need to use the - session after the delete or you can be sure that none of the matched objects - are in the session. The behavior of deleted objects still in the session is - undefined. + don't synchronize the session. This option is the most efficient and is reliable + once the session is expired, which typically occurs after a commit(). Before + the expiration, objects may still remain in the session which were in fact deleted + which can lead to confusing results if they are accessed via get() or already + loaded collections. 'fetch' performs a select query before the delete to find objects that are matched