[session pool] dont check closed session when calling set_pool from super_session
--- 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,