[Erp5-report] r36628 seb - /erp5/trunk/products/ZMySQLDA/DA.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Jun 28 11:20:18 CEST 2010
Author: seb
Date: Mon Jun 28 11:20:14 2010
New Revision: 36628
URL: http://svn.erp5.org?rev=36628&view=rev
Log:
Fixed cases where two distinct connections where opened for the
same connector, the same thread, within a single transaction. It
fixes some possible lock wait timeout when two distinct connections
were used instead of one.
Modified:
erp5/trunk/products/ZMySQLDA/DA.py
Modified: erp5/trunk/products/ZMySQLDA/DA.py
URL: http://svn.erp5.org/erp5/trunk/products/ZMySQLDA/DA.py?rev=36628&r1=36627&r2=36628&view=diff
==============================================================================
--- erp5/trunk/products/ZMySQLDA/DA.py [utf8] (original)
+++ erp5/trunk/products/ZMySQLDA/DA.py [utf8] Mon Jun 28 11:20:14 2010
@@ -97,6 +97,7 @@ from App.ImageFile import ImageFile
from ExtensionClass import Base
from DateTime import DateTime
from thread import allocate_lock
+from Acquisition import aq_parent
manage_addZMySQLConnectionForm=HTMLFile('connectionAdd',globals())
@@ -123,6 +124,12 @@ class Connection(DABase.Connection):
def factory(self): return ThreadedDB
def connect(self, s):
+ # if acquisition wrappers are not there, do not connect in order to prevent
+ # having 2 distinct connections for the same connector. Without this
+ # two following lines, there is in the pool for the same connector two connections,
+ # one for (connection_id,) and another one for (some, path, connection_id,)
+ if aq_parent(self) is None:
+ return self
try:
database_connection_pool_lock.acquire()
self._v_connected = ''
More information about the Erp5-report
mailing list