Re: [Modeling-users] Warning: possible problem with Zope, maybe MT-related
Status: Abandoned
Brought to you by:
sbigaret
|
From: Sebastien B. <sbi...@us...> - 2003-03-07 09:52:15
|
Hi,
> Just a quick note to warn you about the fact that I currently have a
> very annoying bug revealing itself on a zope-based application using
> the modeling.
>=20
> It is still not clear where the bug is, but it has been reported
> that it was also observed with zope and ZPsycopgDA alone.
>=20
> It might be a MT-issue, or just a Zope-issue (this is just my guess at
> this point).
>=20
> Description of the problem: at some point, the psycopg adaptor stops
> adding BEGIN and END or ABORT at the begin/end of the txn. From
> that point, none of the sql statements sent to the pg server is
> committed anymore, hence they are lost.
It seems that the problem is triggered when the same psycopg cursor is
used in two different threads.
I submitted and fixed bug #699272 for the modeling framework: when
calling EditingContext.objectsCountWithFetchSpecification() the
underlying adaptorChannel was not closed at the end. Hence, even if
MDL_PERMANENT_DB_CONNECTION was unset, the corresponding
(psycopg-)connection to the database was not closed. This makes it
possible for the same cursor to be reused by an other request,
especially in a different thread (when used within zope e.g.) and as a
consequence it made the bug more likely to occur.
--> If you are using the framework in a MT environment, please update
--> your copy of DatabaseChannel w/ v.1.10 or apply the patch attached
--> below. Additionally, please remember that you are strongly advised
--> against setting MDL_PERMANENT_DB_CONNECTION in a multi-threaded
--> environment.
This does not guarantee that the problem won't show up, but it will
dramatically reduce its frequency. Hopefully a complete resolution for
the bug will be found, I'll keep you informed.
Regards,
-- S=E9bastien.
------------------------------------------------------------------------
retrieving revision 1.9
retrieving revision 1.10
diff -r1.9 -r1.10
32c32
< $Id: DatabaseChannel.py,v 1.9 2003/02/20 11:59:52 sbigaret Exp $
---
> $Id: DatabaseChannel.py,v 1.10 2003/03/07 09:27:18 sbigaret Exp $
36c36
< __version__=3D'$Revision: 1.9 $'[11:-2]
---
> __version__=3D'$Revision: 1.10 $'[11:-2]
292c292
< self.__isFetchInProgress=3D0
---
> self.cancelFetch()
------------------------------------------------------------------------
|