server/sources/native.py
changeset 9465 86d4b41ae339
parent 9463 d62e13eba033
child 9466 c3a5f4507f12
--- a/server/sources/native.py	Wed Jan 22 15:35:13 2014 +0100
+++ b/server/sources/native.py	Thu Jun 27 09:18:39 2013 +0200
@@ -291,12 +291,13 @@
         # running unittest_multisources with the wrapping below
         if self.dbdriver == 'sqlite' and \
                not getattr(repo.config, 'no_sqlite_wrap', False):
+            from cubicweb.server.pool import ConnectionsSet
             self.dbhelper.dbname = abspath(self.dbhelper.dbname)
             self.get_connection = lambda: SqliteCnxLoggingWrapper(self)
             self.check_connection = lambda cnx: cnx
-            def cnxset_freed(cnx):
-                cnx.close()
-            self.cnxset_freed = cnxset_freed
+            def cnxset_freed(self):
+                self.cnx.close()
+            ConnectionsSet.cnxset_freed = cnxset_freed
         if self.dbdriver == 'sqlite':
             self._create_eid = None
             self.create_eid = self._create_eid_sqlite