server/session.py
changeset 10059 dab538127d72
parent 9979 9ccdb3751fbe
child 10074 ab956b780d4e
child 10228 d8a208f7e3d1
--- 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