diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-01-08 15:33:34 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2009-01-08 15:33:34 +0000 |
| commit | e9f787f9fee4f77aa862d5d209f6c840079c6f3c (patch) | |
| tree | c47e6b17296308afe89e41b0c2c519ca18ecb560 | |
| parent | c695c3e061679468633d1c77822869e5ab07ef9a (diff) | |
| download | sqlalchemy-e9f787f9fee4f77aa862d5d209f6c840079c6f3c.tar.gz | |
query.delete(False) is not so bad
| -rw-r--r-- | lib/sqlalchemy/orm/query.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index c5349e052..03030f8b0 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 |
