From 01b6183ae4a084d9673281d177f3e06fdcc8d005 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Wed, 23 Sep 2009 09:55:59 +0000
Subject: [PATCH]  - use transaction.commit instead of obsoleted
 get_transaction().commit

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

diff --git a/product/ZMySQLDDA/tests/testDeferredConnection.py b/product/ZMySQLDDA/tests/testDeferredConnection.py
index e8ae34a87c..d4afd715e5 100644
--- a/product/ZMySQLDDA/tests/testDeferredConnection.py
+++ b/product/ZMySQLDDA/tests/testDeferredConnection.py
@@ -32,6 +32,7 @@ from _mysql_exceptions import OperationalError
 from Products.ZMySQLDA.db import hosed_connection
 from thread import get_ident
 from zLOG import LOG
+import transaction
 
 UNCONNECTED_STATE = 0
 CONNECTED_STATE = 1
@@ -124,7 +125,7 @@ class TestDeferredConnection(ERP5TypeTestCase):
     connection = self.getDeferredConnection()
     connection.query('REPLACE INTO `full_text` SET `uid`=0, `SearchableText`="dummy test"')
     try:
-      get_transaction().commit()
+      transaction.commit()
     except OperationalError:
       self.fail()
     except:
@@ -146,7 +147,7 @@ class TestDeferredConnection(ERP5TypeTestCase):
     connection._query = connection.db.query
     try:
       try:
-        get_transaction().commit()
+        transaction.commit()
       except OperationalError, m:
         if m[0] not in hosed_connection:
           raise
@@ -171,7 +172,7 @@ class TestDeferredConnection(ERP5TypeTestCase):
     self.monkeypatchConnection(connection)
     try:
       try:
-        get_transaction().commit()
+        transaction.commit()
       except OperationalError, m:
         LOG('TestDeferredConnection', 0, 'OperationalError exception raised: %s' % (m, ))
         self.fail()
@@ -190,7 +191,7 @@ class TestDeferredConnection(ERP5TypeTestCase):
     # Queue a query
     connection.query('REPLACE INTO `full_text` SET `uid`=0, `SearchableText`="dummy test"')
     self.assertEqual(len(connection._sql_string_list), 1)
-    get_transaction().commit()
+    transaction.commit()
     connection.query('REPLACE INTO `full_text` SET `uid`=0, `SearchableText`="dummy test"')
     self.assertEqual(len(connection._sql_string_list), 1)
 
-- 
2.30.9