# HG changeset patch # User Julien Cristau # Date 1411473072 -7200 # Node ID dab538127d72cf7a38e5f357c3b235b698c6ab68 # Parent d47c318f95b22489e60ea01388fb73798de8d252 [session] don't silently ignore commits commits while in the precommit or postcommit phase are silently ignored. This is OK in precommit since there'll be a commit afterwards anyway; OTOH in postcommit it may surprise the developer who didn't read the documentation for postcommit operations carefully enough. Related to #4383922. diff -r d47c318f95b2 -r dab538127d72 server/session.py --- a/server/session.py Mon Nov 24 11:49:28 2014 +0100 +++ b/server/session.py Tue Sep 23 13:51:12 2014 +0200 @@ -1077,8 +1077,13 @@ cstate = self.commit_state if cstate == 'uncommitable': raise QueryError('transaction must be rolled back') - if cstate is not None: + if cstate == 'precommit': + self.warn('calling commit in precommit makes no sense; ignoring commit') return + if cstate == 'postcommit': + self.critical('postcommit phase is not allowed to write to the db; ignoring commit') + return + assert cstate is None # on rollback, an operation should have the following state # information: # - processed by the precommit/commit event or not