Reusing connections quixote 2

Arturo FM <[email protected]> Mon, 6 Nov 2006 10:07:43 +0000 (GMT)
Newsgroups gmane.comp.web.quixote.user
Message-ID <[email protected]>
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