[Zope-DB] egenix ODBC DA spontaneously closing

M.-A. Lemburg mal@lemburg.com
Tue, 13 May 2003 22:28:59 +0200

Wade Leftwich wrote:
> A couple of days ago I upgraded to version 1.05 of the egenix mxODBC 
> Zope DA.
> (Windows 2000 Server, SQL 2000, Zope 2.6.1.)
> Now my database connection is closing itself, typically within a few 
> minutes of being opened.
> This is a production server, so I'm going to roll back to 1.04 right now.
> But has anyone encountered this problem?

Hmm, it seems that you've hit a bugglet in a new feature:

Version 1.0.5 has a new feature called "lazy connect":
The Zope DA connects to the data source the first time
a connection is requested from Zope. When Zope loads the
connection object into memory it defers the connection process.
As a result, Zope interprets the connection as being closed,
even though its state is that of a connected connection.
That is probably causing your problem.

Here's a work-around that turns this feature off:

Put the following into a startup script or some other
Python module that is loaded before the first Zope
connection is loaded into memory:

import Products.mxODBCZopeDA.ZopeDA
Products.mxODBCZopeDA.ZopeDA.lazy_connect = 0

We'll announce a fix tomorrow.

Sorry for the trouble,
Marc-Andre Lemburg

Professional Python Software directly from the Source  (#1, May 13 2003)
 >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
EuroPython 2003, Charleroi, Belgium:                        42 days left