[Zope] Accessing ZSQL connection from external method

Ragnar Beer rbeer@uni-goettingen.de
Sun, 26 Mar 2000 14:36:19 +0200


Howdy!

I'm making heavy use of MySQLdb in my external methods. Now I just 
realized that ZSQL-connections are kept open permanently and it would 
save a lot of time if I wouldn't have to open a connection each time 
my external method is invoked but use the already existing 
ZSQL-connection instead.
My question: How can I access a ZSQL-connection (ZMySQLDA) from an 
external method?

--Ragnar

P.S.: I benchmarked MySQLdb and found that opening a connection took 
1.2ms on my systen whereas a very short request for authentication 
took only 1.1ms. So beeing able to use an existing connection would 
result in about 100% performance gain (at least at first glance).