server/repository.py
branchstable
changeset 8837 f7f4238ffe3c
parent 8699 864ffd247d70
child 8838 27393e484974
--- a/server/repository.py	Thu Mar 28 15:43:23 2013 +0100
+++ b/server/repository.py	Tue Apr 02 14:46:13 2013 +0200
@@ -882,10 +882,11 @@
         See :class:`cubicweb.dbapi.Connection.call_service`
         and :class:`cubicweb.server.Service`
         """
+        session = self._get_session(sessionid)
         def task():
-            session = self._get_session(sessionid, setcnxset=True)
-            service = session.vreg['services'].select(regid, session, **kwargs)
+            session.set_cnxset()
             try:
+                service = session.vreg['services'].select(regid, session, **kwargs)
                 return service.call(**kwargs)
             finally:
                 session.rollback() # free cnxset