durusmail: quixote-users: Reusing connections quixote 2
Reusing connections quixote 2
2006-11-06
Re: Reusing connections quixote 2
2006-11-06
Reusing connections quixote 2
Arturo FM
2006-11-06
Hi!!

I'm writting a web application using Quixote 2. I need to reuse database
connections. I have seen the Wiki but it's about Quixote 1. I'm using mod_scgi
(Apache) and the 'scgi_server.py' script.
I wrote a new class that inherit of Publisher. In its constructor I connect to
dabase. But, where I can to disconnect it? Some code:

class MyPublisher(Publisher):
    def __init__(self, package, **kwargs):
        Publisher.__init__(self, package, **kwargs)
        self.conn = MySQLdb.connect(user='a', passwd='b', host='localhost', \
                                   db='mydb')
    def cleanup(self):
        self.conn.close()

Where I could to call to 'cleanup' method?

Can anybody helps me?

Regards,
Arturo




______________________________________________
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com
reply