289 self._storages = {} |
289 self._storages = {} |
290 # XXX no_sqlite_wrap trick since we've a sqlite locking pb when |
290 # XXX no_sqlite_wrap trick since we've a sqlite locking pb when |
291 # running unittest_multisources with the wrapping below |
291 # running unittest_multisources with the wrapping below |
292 if self.dbdriver == 'sqlite' and \ |
292 if self.dbdriver == 'sqlite' and \ |
293 not getattr(repo.config, 'no_sqlite_wrap', False): |
293 not getattr(repo.config, 'no_sqlite_wrap', False): |
|
294 from cubicweb.server.pool import ConnectionsSet |
294 self.dbhelper.dbname = abspath(self.dbhelper.dbname) |
295 self.dbhelper.dbname = abspath(self.dbhelper.dbname) |
295 self.get_connection = lambda: SqliteCnxLoggingWrapper(self) |
296 self.get_connection = lambda: SqliteCnxLoggingWrapper(self) |
296 self.check_connection = lambda cnx: cnx |
297 self.check_connection = lambda cnx: cnx |
297 def cnxset_freed(cnx): |
298 def cnxset_freed(self): |
298 cnx.close() |
299 self.cnx.close() |
299 self.cnxset_freed = cnxset_freed |
300 ConnectionsSet.cnxset_freed = cnxset_freed |
300 if self.dbdriver == 'sqlite': |
301 if self.dbdriver == 'sqlite': |
301 self._create_eid = None |
302 self._create_eid = None |
302 self.create_eid = self._create_eid_sqlite |
303 self.create_eid = self._create_eid_sqlite |
303 self.binary_to_str = self.dbhelper.dbapi_module.binary_to_str |
304 self.binary_to_str = self.dbhelper.dbapi_module.binary_to_str |
304 |
305 |