[Zope] database connections from external method

Tino Wildenhain tino at wildenhain.de
Wed Oct 19 05:57:34 EDT 2005


Vangelis Mihalopoulos schrieb:
> 
> Hi,
> 
> I want an external method to access a mysql database on each call. For 
> now, i open up a new connection on every call, but this probably won't 
> scale much either on performance (new connection on each call is quite 
> an overhead) or availability (the number of open connections is 
> restricted).
> 
> I am thinking of using a Z Database Connection (mysql) from within an 
> external method, without using Z SQL Methods, but can't figure out how i 
> can "safely" do it... It crossed my mind to take a peek to the Z SQL 
> Method source, but i don't know if such an approach would be thread safe...
> 

The threading is handled by the ZDA, so you can use query() or what
the method actually is. Otoh, what do you think you gain from
circumventing ZSQL Methods?

Regards
Tino


More information about the Zope mailing list