Logo Search packages:      
Sourcecode: zope-loginmanager version File versions

ZPatterns::Transactions::Transactional Class Reference

Inheritance diagram for ZPatterns::Transactions::Transactional:

ZPatterns::Transactions::TransientMapping

List of all members.


Detailed Description

DEPRECATED Mix-in Adapter to simplify ZODB Transaction messages

DO NOT USE THIS!!!

Whenever your subclass does work which requires transactional behavior, 
it should call self._register(), to ensure it is registered with the current
transaction.  Your subclass will then be able to receive the following
(translated) messages from the ZODB transaction:

_checkpoint() -- 
    apply work done so far (this is where committing should mostly go)

_revert() -- 
    abort work done since last checkpoint or since the transaction began
    if not yet checkpointed

_rollback() -- 
    abort all checkpointed work (this call is always preceded by a _revert()
    call to handle any work which was not yet checkpointed, and is always
    followed by a _cleanup() call, so don't make it do the work of either.)

_vote() -- 
    raise an exception here if you want to force the transaction to abort

_finalize() -- 
    make all work done permanent (try not to refer to objects' states here)

_cleanup() --
    called whenever a transaction is terminated, whatever its outcome

Your revert, rollback, finalize, and cleanup methods should not raise any 
exceptions.  An untrapped exception from _finalize() (or _cleanup() after
_finalize()) will put the entire ZODB application into "hosed" state which
can only be undone by an application restart.  The ZODB transaction will
in most cases silently toss exceptions from your _revert() and _rollback()
routines, so it would be a good idea to log them somewhere.

Definition at line 124 of file Transactions.py.


Private Member Functions

def _checkpoint
def _cleanup
def _finalize
def _register
def _revert
def _rollback
def _unregister
def _vote

Static Private Attributes

 _v_registered = None

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index