server/sources/native.py
changeset 9996 65bb21409292
parent 9984 793377697c81
child 10000 4352b7ccde04
child 10037 6b83ceda8323
--- a/server/sources/native.py	Mon Sep 15 17:23:22 2014 +0200
+++ b/server/sources/native.py	Mon Sep 15 10:06:07 2014 +0200
@@ -1017,14 +1017,16 @@
         sql = self.sqlgen.select('tx_entity_actions', restr,
                                  ('txa_action', 'txa_public', 'txa_order',
                                   'etype', 'eid', 'changes'))
-        cu = self.doexec(cnx, sql, restr)
-        actions = [tx.EntityAction(a,p,o,et,e,c and loads(self.binary_to_str(c)))
-                   for a,p,o,et,e,c in cu.fetchall()]
+        with cnx.ensure_cnx_set:
+            cu = self.doexec(cnx, sql, restr)
+            actions = [tx.EntityAction(a,p,o,et,e,c and loads(self.binary_to_str(c)))
+                       for a,p,o,et,e,c in cu.fetchall()]
         sql = self.sqlgen.select('tx_relation_actions', restr,
                                  ('txa_action', 'txa_public', 'txa_order',
                                   'rtype', 'eid_from', 'eid_to'))
-        cu = self.doexec(cnx, sql, restr)
-        actions += [tx.RelationAction(*args) for args in cu.fetchall()]
+        with cnx.ensure_cnx_set:
+            cu = self.doexec(cnx, sql, restr)
+            actions += [tx.RelationAction(*args) for args in cu.fetchall()]
         return sorted(actions, key=lambda x: x.order)
 
     def undo_transaction(self, cnx, txuuid):