thank's jonathan for answer. We only close scoped session when pyramid 
webapp start.
After that, scoped session should be recycle as usual. Nothing different 
than pyramid's alchemy
scaffold. I don't see a difference between a scoped session coming from a 
static dict attached to 
a class and a scoped session attached to a module.

But this bug is very usual with meinheld. I put an issue to mopemope 
github. Meinheld seems
to use greenlet and scoped session. I'm still trying to build a sample 
webapp.

Le mardi 23 avril 2013 17:33:45 UTC+2, Jonathan Vanasco a écrit :
>
> the problems you're describing seem to be random , and not necessarily 
> tied to render vs render_response.  
>
> it looks like you're using sessions incorrectly , and probably seeing 
> issues pop up because some pages are lazyloading attributes while others 
> don't have an attribute to load.
>
> scoped_session should be created and alive for the entirety of each 
> request; it looks like your 'get_session' is immediately closing it.  it 
> sounds like you're treating the scoped sessions like a "database connection 
> string" or persistent connection ( which would often be one per request per 
> app , unless you're connection pooling ).  scoped sessions are a unit of 
> work for the database connection, and typically last for a single pageview 
> on a web app.
>
>
> i found the best way to deal with scoped sessions is to store them in a 
> global request attribute, and then register a cleanup handler to close them 
> out afterwards.
>
> they have very little overhead on setting up ( if you have a lot and don't 
> use them all ).  you can also just use lazy-loading / memoization 
> techniques to create them only when needed.  
>
>
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to