From: Tom S. <tom...@li...> - 2000-12-03 22:15:17
|
Chuck Esterbrook wrote: > > At 09:43 AM 12/3/2000 +0000, Tom Schwaller wrote: > > > MiddleKit maps object and relational data in a manner such that you > > > primarily work with Python objects whose persistence in a SQL database is > > > largely automated. It does not do anything with connection pooling at this > > > point. > > > >quite ambitious. Hope we have something to test soon :) > > "Quite ambitious"? You are correct, sir. :-) :-)) > >Connections between tables are quit difficult to > >get right. I once saw the Open Source Tool POSSL > >(http://www.possl.org) in action, where you visually > >select the tables, make a selection of the fields per > >drag and dropand the rest is for you. It even detects > >the connnections between tables (if not, you can give hints). > > I made an earlier design decision that has helped quite a bit, although it > leaves MiddleKit (MK) with a significant caveat. MK lets you define a > data-centric object model from which it can generate Python and SQL at > design time, and perform operations with at run time. It does not allow you > to take an existing legacy database and map that to objects like some other > tools do. > > The advantage here is that MK is easier to implement and can have control > over the implementation of the SQL schema. The disadvantage is that it > can't be applied to legacy DBs. thanks for the info.. > > > There is such a class floating around in the message archives. > > > >I've found it, applied the 2 proposed patches and put it in > >Webware/WebKit/Cans/DBPool.py (DBPool.py file is attached). > >Then I teste it according to another posting (Examples/DB.py) > > > >from ExamplePage import ExamplePage > >import MySQLdb > > > >class DB(ExamplePage): > > > > def writeContent(self): > > self.writeln('<p>Welcome to the DBPooling example</p>') > > pool = self.getCan('DBPoolCan', 'DBPool', 'application', > > MySQLdb, 5, host='localhost', user='..', > > passwd='..', db='...') > > db = pool.getConnection() > > cursor = db.cursor() > > cursor.execute("SELECT realname FROM users WHERE userid < 25") > > for realname in cursor.fetchall(): > > self.writeln('%s<br>' % realname) > > db.close() > > > > > >Works fine (my first Can based SQL example :-)). > >But then I wanted it to know: > > > >/usr/sbin/ab -n 1000 -c 2 http://localhost/wpy/Examples/DB.py > > > >Requests per second: 48.28 > >WOW! Then I overloaded the site with > > > >/usr/sbin/ab -n 1000 -c 10 http://localhost/wpy/Examples/DB.py > >Requests per second: 31.40 > > Sweet. I guess this answers someone else's question on the list (er, maybe > it was yours!). jep, but the exeption it throws is still mysterious.. > All future enhancements not directly necessary for or intimately tied with > serving servlets will reside outside of WebKit as plug-ins (e.g., Python > packages that WebKit loads). Plug-ins can be replaced and disabled as users > see fit. We have this architecture now. Nevertheless I hope, that somebody with more connection pooling know-how than myself, writes such a beast, because high performance database examples will probably be the first thing people new to WebKit ask for. I'll port some of my website stuff in the coming weeks to see if I can get what I want, but see no real problems there. Is the above Can example correct? If you do not have cookies enabled then URL rewriting should be a fallback solution like in the Java case. There was an example on this list some thime ago, how to do that (i I remember it correctly), but hey, everybody is welcome to contribute small code snippets on this list (that's the way I learn :-)) > >ah, I forgot: the more I play with WebWare, the more > >I like it. Well done , guys :-) > > Glad to hear it. jep. more people should know about it, but this takes some time.. > >P.S. Did anybody try to get WebWare running with Jython? > > I haven't heard of anyone trying this yet. it could work, maybe I'll try that myself in a free minute... I could access EJBs in that way and also use RMI, which would be pretty cool. Where do you think one could contribute code right now? Some wishes? -- Tom Schwaller http://www.linux-community.de http://www.linux-magazin.de/ |