server/session.py
changeset 2764 55579275a091
parent 2680 66472d85d548
child 2778 3f6dfc312760
child 2781 4e1ad9d6a3e7
--- a/server/session.py	Tue Aug 11 17:02:50 2009 +0200
+++ b/server/session.py	Tue Aug 11 17:03:27 2009 +0200
@@ -208,9 +208,9 @@
         """connections pool, set according to transaction mode for each query"""
         return getattr(self._threaddata, 'pool', None)
 
-    def set_pool(self):
+    def set_pool(self, checkclosed=True):
         """the session need a pool to execute some queries"""
-        if self._closed:
+        if checkclosed and self._closed:
             raise Exception('try to set pool on a closed session')
         if self.pool is None:
             # get pool first to avoid race-condition
@@ -335,7 +335,7 @@
                 csession = ChildSession(self)
             self._threaddata.childsession = csession
         # need shared pool set
-        self.set_pool()
+        self.set_pool(checkclosed=False)
         return csession
 
     def unsafe_execute(self, rql, kwargs=None, eid_key=None, build_descr=True,