diff options
author | Gunnlaugur Þór Briem <gunnlaugur@gmail.com> | 2014-08-21 18:42:08 +0000 |
---|---|---|
committer | Gunnlaugur Þór Briem <gunnlaugur@gmail.com> | 2014-08-21 18:43:07 +0000 |
commit | 42a65014f8cf39d29ca9e411e511b613a3ffa446 (patch) | |
tree | 8a45fa9af798971614302d1040e04083e7a6b3c3 | |
parent | 374173e89d4e21a75bfabd8a655d17c247b6f1fc (diff) | |
download | sqlalchemy-pr/131.tar.gz |
Add note on begin_nested requiring rollback/commitpr/131
Avoid confusion about rollback/commit "must be issued" after
``session.begin_nested()`` --- this might be taken to mean call must be
*added*, but that's only true if not using the return value as a context
manager.
-rw-r--r-- | doc/build/orm/session.rst | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/doc/build/orm/session.rst b/doc/build/orm/session.rst index b47e70d53..78ae1ba81 100644 --- a/doc/build/orm/session.rst +++ b/doc/build/orm/session.rst @@ -1773,7 +1773,10 @@ method:: of times, which will issue a new SAVEPOINT with a unique identifier for each call. For each :meth:`~.Session.begin_nested` call, a corresponding :meth:`~.Session.rollback` or -:meth:`~.Session.commit` must be issued. +:meth:`~.Session.commit` must be issued. (But note that if the return value is +used as a context manager, i.e. in a with-statement, then this rollback/commit +is issued by the context manager upon exiting the context, and so should not be +added explicitly.) When :meth:`~.Session.begin_nested` is called, a :meth:`~.Session.flush` is unconditionally issued |