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