server/session.py
branchstable
changeset 6385 9f91d09ee5fa
parent 6071 c7a9e25153c2
child 6401 d7f5d873e1b8
equal deleted inserted replaced
6383:19ebe0b994d6 6385:9f91d09ee5fa
    29 
    29 
    30 from logilab.common.deprecation import deprecated
    30 from logilab.common.deprecation import deprecated
    31 from rql.nodes import ETYPE_PYOBJ_MAP, etype_from_pyobj
    31 from rql.nodes import ETYPE_PYOBJ_MAP, etype_from_pyobj
    32 from yams import BASE_TYPES
    32 from yams import BASE_TYPES
    33 
    33 
    34 from cubicweb import Binary, UnknownEid, schema
    34 from cubicweb import Binary, UnknownEid, QueryError, schema
    35 from cubicweb.req import RequestSessionBase
    35 from cubicweb.req import RequestSessionBase
    36 from cubicweb.dbapi import ConnectionProperties
    36 from cubicweb.dbapi import ConnectionProperties
    37 from cubicweb.utils import make_uid, RepeatList
    37 from cubicweb.utils import make_uid, RepeatList
    38 from cubicweb.rqlrewrite import RQLRewriter
    38 from cubicweb.rqlrewrite import RQLRewriter
    39 
    39 
   724             assert not self.pending_operations
   724             assert not self.pending_operations
   725             self._clear_thread_data()
   725             self._clear_thread_data()
   726             self._touch()
   726             self._touch()
   727             self.debug('commit session %s done (no db activity)', self.id)
   727             self.debug('commit session %s done (no db activity)', self.id)
   728             return
   728             return
   729         if self.commit_state:
   729         cstate = self.commit_state
       
   730         if cstate == 'uncommitable':
       
   731             raise QueryError('transaction must be rollbacked')
       
   732         if cstate is not None:
   730             return
   733             return
   731         # on rollback, an operation should have the following state
   734         # on rollback, an operation should have the following state
   732         # information:
   735         # information:
   733         # - processed by the precommit/commit event or not
   736         # - processed by the precommit/commit event or not
   734         # - if processed, is it the failed operation
   737         # - if processed, is it the failed operation