server/hook.py
branchstable
changeset 5837 67c722b36f7c
parent 5744 6b2a987370e8
child 5848 b5640328ffad
equal deleted inserted replaced
5836:e654c13b57b8 5837:67c722b36f7c
   367 class Operation(object):
   367 class Operation(object):
   368     """an operation is triggered on connections pool events related to
   368     """an operation is triggered on connections pool events related to
   369     commit / rollback transations. Possible events are:
   369     commit / rollback transations. Possible events are:
   370 
   370 
   371     precommit:
   371     precommit:
   372       the pool is preparing to commit. You shouldn't do anything things which
   372       the pool is preparing to commit. You shouldn't do anything which
   373       has to be reverted if the commit fail at this point, but you can freely
   373       has to be reverted if the commit fails at this point, but you can freely
   374       do any heavy computation or raise an exception if the commit can't go.
   374       do any heavy computation or raise an exception if the commit can't go.
   375       You can add some new operation during this phase but their precommit
   375       You can add some new operations during this phase but their precommit
   376       event won't be triggered
   376       event won't be triggered
   377 
   377 
   378     commit:
   378     commit:
   379       the pool is preparing to commit. You should avoid to do to expensive
   379       the pool is preparing to commit. You should avoid to do to expensive
   380       stuff or something that may cause an exception in this event
   380       stuff or something that may cause an exception in this event
   388       the transaction has been either rollbacked either:
   388       the transaction has been either rollbacked either:
   389        * intentionaly
   389        * intentionaly
   390        * a precommit event failed, all operations are rollbacked
   390        * a precommit event failed, all operations are rollbacked
   391        * a commit event failed, all operations which are not been triggered for
   391        * a commit event failed, all operations which are not been triggered for
   392          commit are rollbacked
   392          commit are rollbacked
       
   393 
       
   394     postcommit:
       
   395       The transaction is over. All the ORM entities are
       
   396       invalid. If you need to work on the database, you need to stard
       
   397       a new transaction, for instance using a new internal_session,
       
   398       which you will need to commit (and close!).
   393 
   399 
   394     order of operations may be important, and is controlled according to
   400     order of operations may be important, and is controlled according to
   395     the insert_index's method output
   401     the insert_index's method output
   396     """
   402     """
   397 
   403