Mailing List Archive

... MySql connection pooling
Bonjour,

I'm new to zope/mysql. I succedeed in installing Zmsqlda/mysqldb (tested a "Z SQL method" referencing a "Z Mysql Database connection").

For performance reasons, I want to use connection pooling.
It seems that Zmsqlda/mysqldb implements this (in somme circumstances mysqladmin processlist shows multiple connections).

What's the way to requesting a connection from an external method or from a python script and thus not having to open a new connection anytime the method is run ? Can someone provide me a code sample ?

Thanks a lot for your help,
Sébastien

************************ ADSL JUSQU'A 8 MEGA + 3 MOIS DE TELEPHONE GRATUIT ************************
L'ultra haut débit à 15EUR/mois seulement ! Et vous téléphonez gratuitement en France vers les postes fixes,
hors numéros spéciaux pendant 3 mois.
Pour profiter de cette offre exceptionnelle, cliquez ici : http://register.tiscali.fr/adsl/ (voir conditions sur le site)


_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: ... MySql connection pooling [ In reply to ]
--On 18. August 2005 18:39:29 +0200 seb.champy@infonie.fr wrote:

> Bonjour,
>
> I'm new to zope/mysql. I succedeed in installing Zmsqlda/mysqldb (tested
> a "Z SQL method" referencing a "Z Mysql Database connection").
>
> For performance reasons, I want to use connection pooling.
> It seems that Zmsqlda/mysqldb implements this (in somme circumstances
> mysqladmin processlist shows multiple connections).
>
> What's the way to requesting a connection from an external method or from
> a python script and thus not having to open a new connection anytime the
> method is run ? Can someone provide me a code sample ?
>

You don't have to deal with connections directly. You write your SQL code
using ZSQL methods with are bound to a DA by ID. You call the ZSQL methods
and don't have to care about connection issues. Everything is handled under
the hood automatically for you.

-aj
Re: ... MySql connection pooling [ In reply to ]
Salut Sébastien,

> For performance reasons, I want to use connection pooling.
> It seems that Zmsqlda/mysqldb implements this

I don't know what do you mean with "connection pooling". But...

> (in somme circumstances mysqladmin processlist shows multiple
> connections).

... I had also the problem that processlist showed me a lots ot
"zombie" connections... I solved the problem installing
http://sqlrelay.sourceforge.net/ (you have to install it on your
system, start it as a daemon, install the zope produkt in and create a
sqlrelay connection and then go through this one instead of your "Z
Mysql Database connection")

Cheers,
Michele

--
michele.marcionelli@math.ethz.ch / phone: +41 44 632 6193
eth zentrum / hg g 14 / raemistrasse 101 - ch-8092 zurich

_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db