On Mar 26, 2010, at 3:20 AM, Chris Withers wrote:

Matthew Williams wrote:
From previous posts to this and other lists, it seems that ORMs and threads don't get along too well...

What makes you think that?

First of all, most of my impressions about ORMs come from SQLAlchemy. This quote from this list (http://twistedmatrix.com/pipermail/twisted-python/2009-March/019359.html ) sums up what I have found as well:

"It's much trickier if you want to use the ORM, unless you are very
careful to fully eager load every thing in any possible database
operation if you have need of the information subsequently in your
twisted code. Otherwise you may block unexpectedly simply when
accessing your objects, and end up with database operations from the
main twisted thread."

So perhaps I should have said "SQL Alchemy's ORM and threads don't get along too well"... that's not to say it's impossible, you just have to be exceedingly careful how you use it.

and, as far as I can tell, there's no way to get away from threads if you don't want longish queries to block your entire application.

Right, SQLAlchemy doesn't play nicely with *non-threaded* environments, from my understanding, which may well be wrong ;-)

It took me quite some time to piece together everything I could find related to sAsync (which seems to be a dead but functional project), so I threw up a quick Trac page for it at http://sasync.org .

Cool. What is it you're doing that needs to mix Twisted and SQLAlchemy?

The project (an internal project) doesn't really *need* to mix them... I could just use mysqldb.

Matthew

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to