On Thursday, June 22, 2017 at 1:16:54 PM UTC-4, Michael Merickel wrote:
>
> Even if the session object is the same (which it is) I believe 
> transactional state has been properly cleaned up by zope.sqlalchemy 
> invoking rollback/commit/close on the session itself. However the session 
> and any strong refs it's storing may never be released. As far as I know 
> this shouldn't actually cause a problem but it is a smell for sure.
>

yeah. zope.sqlalchemy properly cleans up by invoking a `close()`.  there 
are a large handful of edge-cases that require scoped sessions to be 
cleaned up via a `remove()` -- IIRC, most are around forked processes, 
threading, connection pooling, and server timeouts.

Your tween should probably be the standard practice for anyone using scoped 
sessions.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/3a8bb884-1953-40da-8be1-e46acb2435dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to