[Zope] Accessing Zope DA connection from external method

Hannu Krosing hannu@tm.ee
Mon, 27 Sep 1999 10:07:53 +0300


Chui Tey wrote:
> 
> Jpenny wrote a little how-to about accessing ZSQL Method from External
> Method. This has really whetted my appetite.
> 
> At the moment, my external methods create and destroy their connections
> to the database whenever they are called. This can potentially be
> expensive when scaling up.
> 
> Can anyone point out how do I reference a Zope DA Connection from an
> external method. This way I can make use of an existing open connection
> instead.

From a short look at the source it seems that you can just use

YourZopeConnection.query('select * from data')

I quess the result will be the same as from using ZSQL Method, but it 
may be something simpler. 

If you find something out, please let us know too ;)

-------------
Hannu