[sqlalchemy] Re: Should create_engine() be called per-process or per-request in threaded wsgi environment?

2008-11-16 Thread Randy Syring
Problem turns out to have been with my ISAPI WSGI interface, it looks like it has a broken thread local model. More details here if anyone is interested: http://groups.google.com/group/sqlalchemy/browse_thread/thread/fbca1399020f6a2e On Nov 6, 5:19 pm, Randy Syring [EMAIL PROTECTED] wrote:

[sqlalchemy] Re: Should create_engine() be called per-process or per-request in threaded wsgi environment?

2008-11-06 Thread John Fries
Yes, I would also like to know what is the appropriate way to use SQLAlchemy with respect to a WSGI server. I've been using Django with SQLAlchemy (not yet supported, but the recipe here http://lethain.com/entry/2008/jul/23/replacing-django-s-orm-with-sqlalchemy/got me moving), and it's not clear

[sqlalchemy] Re: Should create_engine() be called per-process or per-request in threaded wsgi environment?

2008-11-06 Thread Michael Bayer
On Nov 6, 2008, at 1:29 PM, Randy Syring wrote: I am developing a WSGI based web framework with sqlalchemy. I am unclear about when create_engine() should be called. I initially thought that engine creation and metadata would be initialized per process and each thread/request would just

[sqlalchemy] Re: Should create_engine() be called per-process or per-request in threaded wsgi environment?

2008-11-06 Thread Michael Bayer
if you're using create_engine(), you're using a connection pool. The diagram at http://www.sqlalchemy.org/docs/05/dbengine.html illustrates this. On Nov 6, 2008, at 1:35 PM, John Fries wrote: Yes, I would also like to know what is the appropriate way to use SQLAlchemy with respect to a

[sqlalchemy] Re: Should create_engine() be called per-process or per-request in threaded wsgi environment?

2008-11-06 Thread Randy Syring
Thank you for taking the time to respond, I really appreciate it! On Nov 6, 2:46 pm, Michael Bayer [EMAIL PROTECTED] wrote: you should definitely create the engine and metadata on a per-process   basis.   When using SQLite, the engine automatically chooses the   SingletonThreadPool