A session when closed, commited, or rolled back, releases the database connection it acquired from the pool. The session can grab a new connection later on as needed. Also, many objects a session can create have a reference to this session, and the session could be used elsewhere. This leads to the potential of doing database access where one would have thought no database access was going on, even if I'm clearly not re-using the session object anywhere else directly.
ie. I call session.close() before passing my data to a template engine, but one of the objects was a query object (by mistake), which when iterated over will query the database while rendering the template. Is there a standard way I could stop the session object from grabbing another connection to the database and throw an exception instead? If not I'd be open to non-standard ways as well :) Derek -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/RBAVsRSzz1UJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
