]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
note expire_on_commit in the docstring for commit() as well
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 17 Oct 2010 03:50:33 +0000 (23:50 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 17 Oct 2010 03:50:33 +0000 (23:50 -0400)
lib/sqlalchemy/orm/session.py

index 95d29812e576b4df82989675c92bf94d280b86d5..a8d3ab29989f4c3642cebb0d0b2b1b5a2d8f819a 100644 (file)
@@ -593,9 +593,16 @@ class Session(object):
 
     def commit(self):
         """Flush pending changes and commit the current transaction.
-
+        
         If no transaction is in progress, this method raises an
         InvalidRequestError.
+        
+        By default, the :class:`.Session` also expires all database
+        loaded state on all ORM-managed attributes after transaction commit.  
+        This so that subsequent operations load the most recent 
+        data from the database.   This behavior can be disabled using
+        the ``expire_on_commit=False`` option to :func:`.sessionmaker` or
+        the :class:`.Session` constructor.
 
         If a subtransaction is in effect (which occurs when begin() is called
         multiple times), the subtransaction will be closed, and the next call