]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fixed the previous TLTransaction checkin
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 7 Nov 2007 21:46:48 +0000 (21:46 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 7 Nov 2007 21:46:48 +0000 (21:46 +0000)
CHANGES
lib/sqlalchemy/engine/threadlocal.py
test/engine/transaction.py

diff --git a/CHANGES b/CHANGES
index 9f329b1e58cce3935ade6839d542998dd8e77b80..51f659f61b21904f9c51537531dfb5b6e76e8f3b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -41,7 +41,7 @@ CHANGES
     [ticket:573]    
 
   - fixed the close() method on Transaction when using strategy='threadlocal'
-      
+
 - orm
   - eager loading with LIMIT/OFFSET applied no longer adds the primary 
     table joined to a limited subquery of itself; the eager loads now
index 8eb0392082b3a4a94d67e46a8d9ba232326fbbfe..f2b950f2ec8f384b78d7d393323af698138dfd3a 100644 (file)
@@ -80,6 +80,8 @@ class TLSession(object):
     def close(self):
         if self.__tcount == 1:
             self.rollback()
+        elif self.__tcount > 1:
+            self.__tcount -= 1
         
     def is_begun(self):
         return self.__tcount > 0
index ca10965a5e92819abeeca040131e3b1372832446..b6a47e3860037d4eb055c3e1b999617e8fb014a8 100644 (file)
@@ -407,12 +407,8 @@ class TLTransactionTest(PersistTest):
         tlengine.execute(users.insert(), user_id=4, user_name='user4')
         t2.close()
 
-        external_connection = tlengine.connect()
-        result = external_connection.execute("select * from query_users")
-        try:
-            assert len(result.fetchall()) == 4
-        finally:
-            external_connection.close()
+        result = c.execute("select * from query_users")
+        assert len(result.fetchall()) == 4
 
         t.close()