server/session.py
changeset 10074 ab956b780d4e
parent 10005 7769d0f61810
parent 10059 dab538127d72
child 10171 f4f9bff9cf06
--- a/server/session.py	Wed Jul 30 22:26:18 2014 +0200
+++ b/server/session.py	Mon Dec 01 11:13:10 2014 +0100
@@ -1074,8 +1074,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