From d2197ec357495dd352651bf3f2f83a98939e22c0 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Thu, 4 Jan 2007 10:18:14 +0000
Subject: [PATCH] clear the list of sql string at the beginning of a
 transaction, so we do not execute again and again previous sql queries

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11895 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ZMySQLDDA/db.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/product/ZMySQLDDA/db.py b/product/ZMySQLDDA/db.py
index 90cfa51281..abe4708255 100644
--- a/product/ZMySQLDDA/db.py
+++ b/product/ZMySQLDDA/db.py
@@ -119,6 +119,10 @@ class DeferredDB(DB):
         from thread import get_ident
         self._tlock.acquire()
         self._tthread = get_ident()
+        # The Deferred DB instance is sometimes used for several
+        # transactions, so it is required to clear the sql_string_list
+        # each time a transaction starts
+        self.sql_string_list = []
 
     def _finish(self, *ignored):
         from thread import get_ident
-- 
2.30.9