diff -r f7f4238ffe3c -r 27393e484974 server/repository.py --- a/server/repository.py Tue Apr 02 14:46:13 2013 +0200 +++ b/server/repository.py Tue Apr 02 15:11:21 2013 +0200 @@ -883,19 +883,20 @@ and :class:`cubicweb.server.Service` """ session = self._get_session(sessionid) - def task(): - session.set_cnxset() - try: - service = session.vreg['services'].select(regid, session, **kwargs) - return service.call(**kwargs) - finally: - session.rollback() # free cnxset if async: self.info('calling service %s asynchronously', regid) + def task(): + session.set_cnxset() + try: + service = session.vreg['services'].select(regid, session, **kwargs) + return service.call(**kwargs) + finally: + session.rollback() # free cnxset self.threaded_task(task) else: self.info('calling service %s synchronously', regid) - return task() + service = session.vreg['services'].select(regid, session, **kwargs) + return service.call(**kwargs) def user_info(self, sessionid, props=None): """this method should be used by client to: