]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Included documentation about the defaults for create_session() and how they differ...
authorMichael Trier <mtrier@gmail.com>
Thu, 23 Oct 2008 01:47:44 +0000 (01:47 +0000)
committerMichael Trier <mtrier@gmail.com>
Thu, 23 Oct 2008 01:47:44 +0000 (01:47 +0000)
doc/build/content/session.txt

index 7f8d06f90672773dead966bd77c04992bad3c568..4081aa8d72c8648b0b74352a295f507515f523bc 100644 (file)
@@ -90,6 +90,8 @@ As an alternative to `sessionmaker()`, `create_session()` is a function which ca
 
 Configurational arguments accepted by `sessionmaker()` and `create_session()` are the same as that of the `Session` class itself, and are described at [docstrings_sqlalchemy.orm_modfunc_sessionmaker](rel:docstrings_sqlalchemy.orm_modfunc_sessionmaker).
 
+Note that the defaults of `create_session()` are the opposite of that of `sessionmaker()`: autoflush and expire_on_commit are False, autocommit is True. It is recommended to use the `sessionmaker()` function instead of `create_session()`. `create_session()` is used to get a session with no automation turned on and is useful for testing.
+
 ## Using the Session 
 
 ### Quickie Intro to Object States {@name=states}