How are you managing the scoped session? As I'm sure you know, Pyramid does not deal with SQLAlchemy at all, so it should be clear to you where in your code the session is being closed. If you are using pyramid_tm with the ZopeTransactionExtension then sessions are closed upon a transaction.commit(), which normally only happens after all rendering is complete and the request is basically done. If you are calling commit manually, then this could be the case but it would be expected to break no matter what wsgi server you are using.
Anyway, we need to know how you are using SQLAlchemy in order to answer your question. - Michael On Mon, Apr 22, 2013 at 12:09 AM, tuck <[email protected]> wrote: > hello, > we test meinheld a great wsgi server and try to stress a little bit our > pyramid webapp. > We use pserve in production mode with cherrypy > > bug meinheld blow us a big problem with the scoped_session. Some time > the scoped_session is closed (recycle ?) before the end of the template > render. > I don't understand why meinheld is more sensitive than waitress. > > Some templates loads lazy attributes and triggers queries. The usual > exception > came from alchemy's objects that became detached from their scoped session > before > the end of the render > > The usage of render_to_response solve this, but miss the test. > > this is the usual pyramid pattern > @view_config(route_name='my_ro > **ute', renderer='/my_test.mako') > def some_view(request) > return {'some_alchemy_proxy_objects':**my_data_liste} > > against old pylons way . > @view_config(route_name='my_ro**ute') > def some_view(request) > return render_to_response('/my_test.m**ako', > {'some_alchemy_proxy_objects':**my_data_liste}, request=request) > > Does anyone have and idea to keep scoped_session opened during template > renderer ? > > -- > 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. > > > -- 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.
