From: Oisin M. <oi...@en...> - 2003-08-26 18:26:26
|
Ian Bicking wrote: > On Tuesday, August 26, 2003, at 12:00 PM, J-P Lee wrote: > >> Has anyone used SQLObject with woven+twisted? Do they work well >> together? I'm currently using cherrypy and considering switching. >> What do other people use? >> > I don't think SQLObject can work in Twisted. Twisted uses an async > model, and SQLObject blocks all the time (like when transparently > doing database queries), which would bring Twisted to a halt until the > query is finished (which you might not even notice until you have > concurrent requests). I suppose you could wrap every SQLObject > attribute or method access in Twisted's threading stuff to avoid the > blocking, but I don't know if SQLObject would feel very convenient > after doing that. (I think the same blocking problem applies to > CherryPy, but I believe there's also a way to configure it to use a > thread for each request) > > Because of async, when you use Twisted you can't use most normal > Python libraries. They are in a world of their own, at least if you > want to use Twisted style. They do have an ORM of their own. > > I suppose you could use it if you moved to a different thread right > away in your request, then you wouldn't have to guard every SQLObject > attribute access. > > Ian > Hi, I said this already but I've used twisted and sqlobject successfully. I use twisted and sqlobject together in a call card top up system running on a linux server, which has been running without problems for the past few months. I have never had to do anything special to get sqlobject and twisted to work. I simply used sqlobject and If something took I long time to return, I use twisted's deferred mechanism. This allows callback and errorbacks to be set which get called when the database returns. I 've never used CherryPy so I can't compare to it. I've only recently starting using woven in my current kiosk project. But again I have had no problems. I guess it all comes down to how you design and want your system to work. I'm happy for the calls to block since I was using mysql on localhost, and it never take long to excute any query. om |