server/session.py
changeset 6401 d7f5d873e1b8
parent 6147 95c604ec89bf
parent 6385 9f91d09ee5fa
child 6427 c8a5ac2d1eaa
--- a/server/session.py	Wed Oct 06 11:57:21 2010 +0200
+++ b/server/session.py	Wed Oct 06 14:04:26 2010 +0200
@@ -31,7 +31,7 @@
 from rql.nodes import ETYPE_PYOBJ_MAP, etype_from_pyobj
 from yams import BASE_TYPES
 
-from cubicweb import Binary, UnknownEid, schema
+from cubicweb import Binary, UnknownEid, QueryError, schema
 from cubicweb.req import RequestSessionBase
 from cubicweb.dbapi import ConnectionProperties
 from cubicweb.utils import make_uid, RepeatList
@@ -738,7 +738,10 @@
             self._touch()
             self.debug('commit session %s done (no db activity)', self.id)
             return
-        if self.commit_state:
+        cstate = self.commit_state
+        if cstate == 'uncommitable':
+            raise QueryError('transaction must be rollbacked')
+        if cstate is not None:
             return
         # on rollback, an operation should have the following state
         # information: