# HG changeset patch # User Sylvain Thénault # Date 1372317519 -7200 # Node ID 86d4b41ae339d5cbad30d419ba22b058778479fc # Parent 6f4f710aef8302de7abd6caaeafcc11e62197624 [multi-sources-removal] Drop cnxset_freed from source interface Though a hack is still needed when using sqlite Related to #2919300 diff -r 6f4f710aef83 -r 86d4b41ae339 server/pool.py --- a/server/pool.py Wed Jan 22 15:35:13 2014 +0100 +++ b/server/pool.py Thu Jun 27 09:18:39 2013 +0200 @@ -77,7 +77,7 @@ def cnxset_freed(self): """connections set is being freed from a session""" - self._source.cnxset_freed(self.cnx) + pass # do nothing by default def reconnect(self): """reopen a connection for this source or all sources if none specified diff -r 6f4f710aef83 -r 86d4b41ae339 server/sources/__init__.py --- a/server/sources/__init__.py Wed Jan 22 15:35:13 2014 +0100 +++ b/server/sources/__init__.py Thu Jun 27 09:18:39 2013 +0200 @@ -249,14 +249,6 @@ cnxset.cnx = self.get_connection() cnxset.cu = cnxset.cnx.cursor() - def cnxset_freed(self, cnx): - """the connections set holding the given connection is being reseted - from its current attached session. - - do nothing by default - """ - pass - # cache handling ########################################################### def reset_caches(self): diff -r 6f4f710aef83 -r 86d4b41ae339 server/sources/native.py --- 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