Christopher Fields
and 1 contributors

NAME

Bio::DB::DBI::TransactionListener - a simple transaction listener

SYNOPSIS

    # see method section

DESCRIPTION

This object is the contract and at the same time a simple (neutral) implementation of a transaction listener.

Transaction listeners are notified before and after commit and rollback on transactions as represented by a Bio::DB::DBI::Transaction objects.

Note that this is a very loose contract in the sense that it is not enforced. Therefore it serves more as a guideline of what you *can* do rather than what you have to do.

You may currently choose between 3 different options on how to listen to transactions:

    - write your own transaction listener that inherits from this
      class and overrides methods as suitable, then use your class to
      add listeners to Transactions

    - let your adaptor or persistent object module inherit from this
      class and thereby make it a listener-compliant object that you
      can then use to register with Transactions

    - register any object with Transaction that implements at least
      one of the methods defined here (if it implements none then
      what's the point?). Transaction will only call the methods
      defined here if the listener actually implements them.

FEEDBACK

Mailing Lists

User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated.

  bioperl-l@bioperl.org                  - General discussion
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists

Support

Please direct usage questions or support issues to the mailing list:

bioperl-l@bioperl.org

rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.

Reporting Bugs

Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web:

  http://redmine.open-bio.org/projects/bioperl/

AUTHOR - Hilmar Lapp

Email hlapp at gmx.net

Describe contact details here

CONTRIBUTORS

Additional contributors names and emails here

APPENDIX

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _

new

 Title   : new
 Usage   : my $obj = Bio::DB::DBI::TransactionListener->new();
 Function: Builds a new Bio::DB::DBI::TransactionListener object 
 Returns : an instance of Bio::DB::DBI::TransactionListener
 Args    :

register_sub

 Title   : register_sub
 Usage   :
 Function: Register an anonymous code block for being executed in
           one of the listener methods.

           This method is probably mostly useful for testing purposes,
           but who knows.

           You may call this as a class method or an object method.

 Example :
 Returns : an instance of this class with the supplied anonymous
           function overriding the specified listener method
 Args    : the code reference to register

           the name(s) of the interface method(s) to register it for
           (optional, if not specified the code block will be
           registered for all 4 methods)

TransactionListener interface methods

The following methods define the interface for TransactionListeners.

before_commit

 Title   : before_commit
 Usage   :
 Function: Called before a commit is issued. 

           Any listener may veto a pending commit by returning
           false. The default implementation returns true.

 Example :
 Returns : TRUE if the transaction is good to be committed, and
           FALSE if it is vetoed.
 Args    : none

after_commit

 Title   : after_commit
 Usage   :
 Function: Called after a commit was issued. 

           The default implementation here does nothing.

 Example :
 Returns : ignored
 Args    : none

before_rollback

 Title   : before_rollback
 Usage   :
 Function: Called before a rollback is issued. 

           A listener cannot veto a pending rollback. The return value
           and even thrown exceptions will be ignored by Transaction.

 Example :
 Returns : ignored
 Args    : none

after_rollback

 Title   : after_rollback
 Usage   :
 Function: Called after a rollback is issued. 

 Example :
 Returns : ignored
 Args    : none