server/session.py
changeset 8999 81a5d57d9230
parent 8996 dcd8aa47adce
child 9016 0368b94921ed
child 9143 1890e0df68fa
equal deleted inserted replaced
8998:4f45968cd956 8999:81a5d57d9230
  1108     @property
  1108     @property
  1109     def cnxset(self):
  1109     def cnxset(self):
  1110         """connections set, set according to transaction mode for each query"""
  1110         """connections set, set according to transaction mode for each query"""
  1111         if self._closed:
  1111         if self._closed:
  1112             self.free_cnxset(True)
  1112             self.free_cnxset(True)
  1113             raise Exception('try to access connections set on a closed session %s' % self.id)
  1113             raise SessionClosedError('try to access connections set on a closed session %s' % self.id)
  1114         return self._tx.cnxset
  1114         return self._tx.cnxset
  1115 
  1115 
  1116     def set_cnxset(self):
  1116     def set_cnxset(self):
  1117         """the session need a connections set to execute some queries"""
  1117         """the session need a connections set to execute some queries"""
  1118         with self._lock: # can probably be removed
  1118         with self._lock: # can probably be removed
  1119             if self._closed:
  1119             if self._closed:
  1120                 self.free_cnxset(True)
  1120                 self.free_cnxset(True)
  1121                 raise Exception('try to set connections set on a closed session %s' % self.id)
  1121                 raise SessionClosedError('try to set connections set on a closed session %s' % self.id)
  1122             return self._tx.set_cnxset()
  1122             return self._tx.set_cnxset()
  1123     free_cnxset = tx_meth('free_cnxset')
  1123     free_cnxset = tx_meth('free_cnxset')
  1124 
  1124 
  1125     def _touch(self):
  1125     def _touch(self):
  1126         """update latest session usage timestamp and reset mode to read"""
  1126         """update latest session usage timestamp and reset mode to read"""