server/repository.py
changeset 8771 519629422391
parent 8748 f5027f8d2478
child 8773 21edcb0a5ed7
equal deleted inserted replaced
8770:2005dcc6150e 8771:519629422391
   842     def commit(self, sessionid, txid=None):
   842     def commit(self, sessionid, txid=None):
   843         """commit transaction for the session with the given id"""
   843         """commit transaction for the session with the given id"""
   844         self.debug('begin commit for session %s', sessionid)
   844         self.debug('begin commit for session %s', sessionid)
   845         try:
   845         try:
   846             session = self._get_session(sessionid)
   846             session = self._get_session(sessionid)
   847             session.set_tx_data(txid)
   847             session.set_tx(txid)
   848             return session.commit()
   848             return session.commit()
   849         except (ValidationError, Unauthorized):
   849         except (ValidationError, Unauthorized):
   850             raise
   850             raise
   851         except Exception:
   851         except Exception:
   852             self.exception('unexpected error')
   852             self.exception('unexpected error')
   855     def rollback(self, sessionid, txid=None):
   855     def rollback(self, sessionid, txid=None):
   856         """commit transaction for the session with the given id"""
   856         """commit transaction for the session with the given id"""
   857         self.debug('begin rollback for session %s', sessionid)
   857         self.debug('begin rollback for session %s', sessionid)
   858         try:
   858         try:
   859             session = self._get_session(sessionid)
   859             session = self._get_session(sessionid)
   860             session.set_tx_data(txid)
   860             session.set_tx(txid)
   861             session.rollback()
   861             session.rollback()
   862         except Exception:
   862         except Exception:
   863             self.exception('unexpected error')
   863             self.exception('unexpected error')
   864             raise
   864             raise
   865 
   865 
  1003         try:
  1003         try:
  1004             session = self._sessions[sessionid]
  1004             session = self._sessions[sessionid]
  1005         except KeyError:
  1005         except KeyError:
  1006             raise BadConnectionId('No such session %s' % sessionid)
  1006             raise BadConnectionId('No such session %s' % sessionid)
  1007         if setcnxset:
  1007         if setcnxset:
  1008             session.set_tx_data(txid) # must be done before set_cnxset
  1008             session.set_tx(txid) # must be done before set_cnxset
  1009             session.set_cnxset()
  1009             session.set_cnxset()
  1010         return session
  1010         return session
  1011 
  1011 
  1012     # data sources handling ###################################################
  1012     # data sources handling ###################################################
  1013     # * correspondance between eid and (type, source)
  1013     # * correspondance between eid and (type, source)