[native] Use cnx.system_sql instead of doexec method in syntax_tree_search
authorDenis Laxalde <denis.laxalde@logilab.fr>
Wed, 20 Jul 2016 09:21:51 +0200
changeset 11430 1ea5ba74a13c
parent 11429 6a9a9ea1e9b9
child 11446 ca90cd9b112b
[native] Use cnx.system_sql instead of doexec method in syntax_tree_search The latter handles connection issues and tries to reconnect. Method syntax_tree_search appears to be called from quite a few place where it seems useful to be resilient to connection issues (authentication for instance). This reconnection logic appears to have disappeared at some point when working on https://www.cubicweb.org/2919309. Could not find the exact reason though...
cubicweb/server/sources/native.py
--- a/cubicweb/server/sources/native.py	Wed Jul 20 09:09:34 2016 +0200
+++ b/cubicweb/server/sources/native.py	Wed Jul 20 09:21:51 2016 +0200
@@ -557,7 +557,7 @@
                 self._cache[cachekey] = sql, qargs, cbs
         args = self.merge_args(args, qargs)
         assert isinstance(sql, string_types), repr(sql)
-        cursor = self.doexec(cnx, sql, args)
+        cursor = cnx.system_sql(sql, args)
         results = self.process_result(cursor, cnx, cbs)
         assert dbg_results(results)
         return results