server/sources/native.py
changeset 10000 4352b7ccde04
parent 9990 c84ad981fc4a
parent 9996 65bb21409292
child 10074 ab956b780d4e
--- a/server/sources/native.py	Thu Sep 25 15:49:13 2014 +0200
+++ b/server/sources/native.py	Fri Oct 17 18:16:58 2014 +0200
@@ -1023,14 +1023,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):