[Zope] Accessing ZSQL connection from external method

John Sutherland garion@garion.mnb.tzo.net
Mon, 27 Mar 2000 08:30:35 -0500


I had the same question, and found the answer in the code of the SQLSession
product.. I haven't tried coding it myself yet, but its does exactly what
you (and myself) are trying to do...

--John Sutherland

> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Ragnar Beer
> Sent: Sunday, March 26, 2000 7:36 AM
> To: zope@zope.org
> Subject: [Zope] Accessing ZSQL connection from external method
>
>
> 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).
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>
>
>