[sources] ensure we have a cnxset in undoable_transactions
authorJulien Cristau <julien.cristau@logilab.fr>
Mon, 07 Apr 2014 12:28:25 +0200
changeset 9605 e6b8931abe17
parent 9604 eba0e1b033ab
child 9606 bf0d8df2aefb
[sources] ensure we have a cnxset in undoable_transactions
server/sources/native.py
--- a/server/sources/native.py	Fri Apr 04 10:46:53 2014 +0200
+++ b/server/sources/native.py	Mon Apr 07 12:28:25 2014 +0200
@@ -1005,9 +1005,10 @@
             restr.update(tearestr)
         # we want results ordered by transaction's time descendant
         sql += ' ORDER BY tx_time DESC'
-        cu = self.doexec(session, sql, restr)
-        # turn results into transaction objects
-        return [tx.Transaction(*args) for args in cu.fetchall()]
+        with session.ensure_cnx_set:
+            cu = self.doexec(session, sql, restr)
+            # turn results into transaction objects
+            return [tx.Transaction(*args) for args in cu.fetchall()]
 
     def tx_info(self, session, txuuid):
         """See :class:`cubicweb.repoapi.ClientConnection.transaction_info`"""