[Zope] DCO2 beta 5 problem.

Dirk Nehring dirk.nehring@bertelsmann.de
Tue, 25 Sep 2001 00:58:31 +0200


On Fri, Sep 14, 2001 at 01:12:11PM +0200, Geir Bĉkholt wrote:
> Hi
>
> We're having a weird problem with the DCO2 beta5 adapter:
> It seems like it leaves connections open, creating new ones as it
> pleases, gradually leaving more connection open , though inactive..
>
> Zope doesn't report anything wrong, although if we check Oracle, the
> number of open (inactive) connections to the Zope seem to grow at a
> steady pace, and in about a day and a half we reach the maximum number
> of open connections (400), and need to kill them off by hand.
>
> We can find no connection to specific method calls doing this, and it
> only happens when using the DCO2 through Zope with ZsqlMethods. No
> problem when using it directly through Python.
>
> We are currently only using it for a simple news-publishing system,
> but will soon have to escalate it to Authentication and other
> intensive applications, - so obviously we fear for the stability of
> our system if the number of connections should grow at a much
> faster pace...

Hi Geir,

here is a workaround for you. Insert the following lines into the class
DB (in db.py):

    def __del__(self):
        print "Closing DB..."
        try:
            self.cursor.close()
        except:
            pass
        try:
            self.db.close()
        except:
            pass

It just closes the connection when the class is destroyed.

Dirk

--
Dirk Nehring             | Phone: +49 5241 80-1560
Bertelsmann mediaSystems | Fax:   +49 5241 80-9518
An der Autobahn 18       | PGP: 69AA BD83 8065 A1DE BBA4
33311 Gütersloh          |      DE54 1F14 C2AE 739A 32D9