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 how to do connection pools and all that
other good stuff.

On Thu, Nov 6, 2008 at 10:29 AM, Randy Syring <[EMAIL PROTECTED]> 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 get a new session.
> However, I have recently run into error messages when using sqlite
> with the framework in a threaded WSGI server:
>
> "SQLite objects created in a thread can only be used in that same
> thread..."
>
> That lead me to this thread:
>
>
> http://groups.google.com/group/pylons-discuss/browse_thread/thread/3d3009cd7421c45a/ed0f3dde401ff474?lnk=gst
>
> Can someone weigh in on this issue?  What are the performance
> ramifications of needing to create an engine on each request as
> opposed to each process?  Do I also need to load my meta data on each
> request or could I just re-bind the engine to the metadata on each
> request?  Should I not bind the engine to the metadata at all but just
> bind it to the session?
>
> Thanks.
> >
>

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

Reply via email to