On Tue, May 20, 2008 at 11:32 AM, Luis Bruno <[EMAIL PROTECTED]> wrote:
> Kumar McMillan escreveu:
>>
>> class BaseController(WSGIController):
>>    def __call__(self, environ, start_response):
>>        model.db.connect(config['sqlalchemy.default.uri'])
>>        try:
>>            return WSGIController.__call__(self, environ, start_response)
>>        finally:
>>            model.db.session.remove()
>>
>
> I must have missed this: why connect-and-bind() on each request?

because otherwise I get an error similar to above: that no engine has
been defined for the current thread.  BTW, I am using mod_wsgi on
nginx so I believe it uses a pool of worker threads for each request,
spawning new ones as needed.

>
> .oO(yeah, I'd forgot about Session.remove() after each request; that was
> painful)
>
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to