server/session.py
changeset 10074 ab956b780d4e
parent 10005 7769d0f61810
parent 10059 dab538127d72
child 10171 f4f9bff9cf06
equal deleted inserted replaced
10068:1b0cb3c6c95e 10074:ab956b780d4e
  1072             # we are inside ensure_cnx_set, don't lose it
  1072             # we are inside ensure_cnx_set, don't lose it
  1073             free_cnxset = False
  1073             free_cnxset = False
  1074         cstate = self.commit_state
  1074         cstate = self.commit_state
  1075         if cstate == 'uncommitable':
  1075         if cstate == 'uncommitable':
  1076             raise QueryError('transaction must be rolled back')
  1076             raise QueryError('transaction must be rolled back')
  1077         if cstate is not None:
  1077         if cstate == 'precommit':
       
  1078             self.warn('calling commit in precommit makes no sense; ignoring commit')
  1078             return
  1079             return
       
  1080         if cstate == 'postcommit':
       
  1081             self.critical('postcommit phase is not allowed to write to the db; ignoring commit')
       
  1082             return
       
  1083         assert cstate is None
  1079         # on rollback, an operation should have the following state
  1084         # on rollback, an operation should have the following state
  1080         # information:
  1085         # information:
  1081         # - processed by the precommit/commit event or not
  1086         # - processed by the precommit/commit event or not
  1082         # - if processed, is it the failed operation
  1087         # - if processed, is it the failed operation
  1083         debug = server.DEBUG & server.DBG_OPS
  1088         debug = server.DEBUG & server.DBG_OPS