##// END OF EJS Templates
docs: clarify that Session usually should be called - methods should not be used directly...
Mads Kiilerich -
r6579:2db16cda default
parent child Browse files
Show More
@@ -182,7 +182,13 b' Notes on the SQLAlchemy session'
182 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
182 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
183
183
184 Each HTTP request runs inside an independent SQLAlchemy session (as well
184 Each HTTP request runs inside an independent SQLAlchemy session (as well
185 as in an independent database transaction). Database model objects
185 as in an independent database transaction). ``Session`` is the session manager
186 and factory. ``Session()`` will create a new session on-demand or return the
187 current session for the active thread. Many database operations are methods on
188 such session instances - only ``Session.remove()`` should be called directly on
189 the manager.
190
191 Database model objects
186 (almost) always belong to a particular SQLAlchemy session, which means
192 (almost) always belong to a particular SQLAlchemy session, which means
187 that SQLAlchemy will ensure that they're kept in sync with the database
193 that SQLAlchemy will ensure that they're kept in sync with the database
188 (but also means that they cannot be shared across requests).
194 (but also means that they cannot be shared across requests).
General Comments 0
You need to be logged in to leave comments. Login now