server/session.py
changeset 9052 4cba5f2cd57b
parent 9050 635862b48485
child 9073 9574df1cd054
equal deleted inserted replaced
9051:944d66870c6a 9052:4cba5f2cd57b
   932         try:
   932         try:
   933             return self.__threaddata.cnx
   933             return self.__threaddata.cnx
   934         except AttributeError:
   934         except AttributeError:
   935             self.set_cnx()
   935             self.set_cnx()
   936             return self.__threaddata.cnx
   936             return self.__threaddata.cnx
       
   937 
       
   938     @property
       
   939     def _current_cnx_id(self):
       
   940         """TRANSITIONAL PURPOSE"""
       
   941         try:
       
   942             return self.__threaddata.cnx.transactionid
       
   943         except AttributeError:
       
   944             return None
   937 
   945 
   938     def get_option_value(self, option, foreid=None):
   946     def get_option_value(self, option, foreid=None):
   939         return self.repo.get_option_value(option, foreid)
   947         return self.repo.get_option_value(option, foreid)
   940 
   948 
   941     def transaction(self, free_cnxset=True):
   949     def transaction(self, free_cnxset=True):
  1209                  DeprecationWarning, stacklevel=2)
  1217                  DeprecationWarning, stacklevel=2)
  1210         self.timestamp = time() # update timestamp
  1218         self.timestamp = time() # update timestamp
  1211         rset = self._execute(self, rql, kwargs, build_descr)
  1219         rset = self._execute(self, rql, kwargs, build_descr)
  1212         rset.req = self
  1220         rset.req = self
  1213         return rset
  1221         return rset
       
  1222 
       
  1223     def close_cnx(self, cnxid):
       
  1224         cnx = self._cnxs.get(cnxid, None)
       
  1225         if cnx is not None:
       
  1226             cnx.free_cnxset(ignoremode=True)
       
  1227             self._clear_thread_storage(cnx)
       
  1228             self._clear_cnx_storage(cnx)
       
  1229 
  1214 
  1230 
  1215     def _clear_thread_data(self, free_cnxset=True):
  1231     def _clear_thread_data(self, free_cnxset=True):
  1216         """remove everything from the thread local storage, except connections set
  1232         """remove everything from the thread local storage, except connections set
  1217         which is explicitly removed by free_cnxset, and mode which is set anyway
  1233         which is explicitly removed by free_cnxset, and mode which is set anyway
  1218         by _touch
  1234         by _touch