On May 8, 2008, at 10:55 AM, Bryn Divey wrote:

>
> We're building an application on TG 1.0.2 using SQLAlchemy 0.3.11 are
> are busy considering our options wrt multiple customer support. We'd
> be hosting the app servers, and there's a low upper-bound to the
> traffic they'll be hit with, so we're trying to figure out a way to
> support multiple customers on a single app instance.

we're going to be merging the 0.5 branch to trunk soon - 0.5 features  
better transaction integration and much cooler Query object.  Why  
start off using 0.3.11 ?  That version is ancient history, is 20%  
slower than 0.4 and probably 30% slower than 0.5.   you should at  
least be on 0.4.5 so that your upgrade path to 0.5 is not very painful.

> The problem is that the system is quite complex and there were
> limitations which made making our DB schemas multi-customer rather
> difficult. This means that we'd basically need to figure out - per
> request - which customer we're working with, and load their database
> up for the lifetime. An experimental solution exists which hijacks
> things like turbogears.database.get_engine and replaces them with a
> function which determines the correct engine to be loaded. I'm still
> wading through it to try get it up and running again (I'm getting
> Visit attached to incorrect session errors atm.)

I dont know about TG's integration but a per-request engine setup is a  
very reasonable (and typical) way to go.    I'd try bypassing their  
SQLA integration altogether if thats possible....all you need is a  
ScopedSession, plug in the engine on each request, and you're ready to  
go.

--~--~---------~--~----~------------~-------~--~----~
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