Bdb packages | Design docs | Source docs | Guidelines | Recent releases

Search | Site Map .

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/BdbModules/BdbTransactionMgr.cc

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: BdbTransactionMgr.cc,v 1.22 2002/06/21 19:13:37 ryd Exp $
00004 //
00005 // Description:
00006 //      Class BdbTransactionMgr implementation file.
00007 //
00008 // Environment:
00009 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00010 //
00011 // Author List:
00012 //      David R. Quarrie        Original Author
00013 //
00014 // Copyright Information:
00015 //      Copyright (C) 1999      Lawrence Berkeley National Laboratory
00016 //
00017 //------------------------------------------------------------------------
00018 #include "BaBar/BaBar.hh"
00019 
00020 //-----------------------
00021 // This Class's Header --
00022 //-----------------------
00023 #include "BdbModules/BdbTransactionMgr.hh"
00024 
00025 //-------------
00026 // C Headers --
00027 //-------------
00028 extern "C" {
00029 #include <sys/types.h>
00030 #include <time.h>
00031 #include <unistd.h>
00032 #include <sys/time.h>
00033 }
00034 
00035 //---------------
00036 // C++ Headers --
00037 //---------------
00038 
00039 //-------------------------------
00040 // Collaborating Class Headers --
00041 //-------------------------------
00042 #include "AbsEvent/AbsEvent.hh"
00043 #include "BdbApplication/BdbDebug.hh"
00044 #include "BdbEventStore/BdbEventStore.hh"
00045 #include "BdbCond/BdbConditions.hh"
00046 #include "BdbConfig/BdbConfig.hh"
00047 #include "BdbModules/BdbTransactionClient.hh"
00048 #include "ErrLogger/ErrLog.hh"
00049 #include <string>
00050 using std::string;
00051 
00052 //-----------------------------------------------------------------------
00053 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
00054 //-----------------------------------------------------------------------
00055 
00056 static const char rscid[] = "$Id: BdbTransactionMgr.cc,v 1.22 2002/06/21 19:13:37 ryd Exp $";
00057 
00058 #include "BdbApplication/BdbCheckPointFunc.hh"
00059 
00060 /**
00061  * BdbForceCommitAndStart is a decorator class which forces commit/start
00062  * checkpoint behaviour irrespective of the setting of 'transNotOpen'
00063  * of the original function.
00064  */
00065 class BdbForceCommitAndStart
00066    : public BdbCheckPointFunc
00067 {
00068    public:
00069       BdbForceCommitAndStart( BdbCheckPointFunc& func ) ;
00070       virtual ~BdbForceCommitAndStart() ;
00071 
00072       // Selectors (const)
00073       virtual bool transNotOpen() ;
00074 
00075       // Modifiers
00076       virtual bool execute() ;
00077 
00078    private:
00079       BdbForceCommitAndStart() ; // stop default
00080       BdbForceCommitAndStart( BdbForceCommitAndStart& lhs ) ; // stop default
00081       BdbForceCommitAndStart& operator=( BdbForceCommitAndStart& lhs ) ; // stop default
00082 
00083       // data
00084       BdbCheckPointFunc& _func ;
00085 
00086 } ;
00087 
00088 BdbForceCommitAndStart::BdbForceCommitAndStart( BdbCheckPointFunc& func )
00089    : _func( func )
00090 {
00091 }
00092 
00093 BdbForceCommitAndStart::~BdbForceCommitAndStart()
00094 {
00095 }
00096 
00097 bool
00098 BdbForceCommitAndStart::transNotOpen()
00099 {
00100    return( !false ) ;
00101 }
00102 
00103 bool
00104 BdbForceCommitAndStart::execute()
00105 {
00106    _func.executeFunc() ;
00107    return( !false ) ;
00108 }
00109 
00110 static const string theName( "BdbTransactionMgr" );
00111 
00112 //      ----------------------------------------
00113 //      -- Static Function Member Definitions --
00114 //      ----------------------------------------
00115 
00116 const string&
00117 BdbTransactionMgr::transactionMgrName()
00118 {
00119    return( theName ) ;
00120 }
00121 
00122 //              ----------------------------------------
00123 //              -- Public Function Member Definitions --
00124 //              ----------------------------------------
00125 
00126 //----------------
00127 // Constructors --
00128 //----------------
00129 
00130 BdbTransactionMgr::BdbTransactionMgr( const char* const theName, 
00131                               const char* const theDescription )
00132   : AppModule( theName, theDescription ), 
00133      _granularity          ( "granularity", this, 60 ),
00134      _granEvents           ( "granEvents", this, false ),
00135      _granRandomize        ( "granRandomize", this, true ) ,
00136      _rpcTimeout           ( "rpcTimeout", this, 100 ),
00137      _cacheInit            ( "cacheInitPages", this, 0 ) ,
00138      _cacheMax             ( "cacheMaxPages", this, 0 ) ,
00139      _fileDescriptors      ( "fileDescriptors", this, 0 ) ,
00140      _checkVTablePointer   ( "checkVTablePointer", this, false ),
00141      _statistics           ( "statistics", this, false ),
00142      _firstEventTransaction( "firstEventTransaction", this, true ),
00143      _commitAndHoldLimit   ( "commitAndHoldLimit", this, 0 ),
00144      _openInitialConTrans  ( "openInitialConTrans", this, false ),
00145      _openInitialCfgTrans  ( "openInitialCfgTrans", this, false ),
00146      _handlePrintFreq      ( "handlePrintFrequency", this, 0 ),
00147      _handlePrintLevel     ( "handlePrintLevel", this, 0 ),
00148      _handlePrintLimit     ( "handlePrintLimit", this, 0 ),
00149      _isPrepared           ( false ),
00150      _useGranularity       ( 0 ),
00151      _totalCount           ( 0 ),
00152      _granularityCount     ( 0 ),
00153      _hasCommitted         ( false ),
00154      _loggingInput         ( false ),
00155      _loggingOutput        ( false ),
00156      _lastTime             ( time( (time_t*)0 ) ),
00157      _commitAndHoldCount   ( 0 ),
00158      _openedInitialConTrans( false ),
00159      _openedInitialCfgTrans( false ),
00160      _handlePrintCount     ( 0 )
00161 {
00162     // Add parameters to list of command handlers
00163     commands( )->append( &_statistics );
00164     commands( )->append( &_granularity );
00165     commands( )->append( &_granEvents );
00166     commands( )->append( &_granRandomize );
00167     commands( )->append( &_rpcTimeout );
00168     commands( )->append( &_cacheInit );
00169     commands( )->append( &_cacheMax );
00170     commands( )->append( &_fileDescriptors );
00171     commands( )->append( &_checkVTablePointer );
00172     commands( )->append( &_firstEventTransaction );
00173     commands( )->append( &_commitAndHoldLimit );
00174     commands( )->append( &_openInitialConTrans );
00175     commands( )->append( &_openInitialCfgTrans );
00176     commands( )->append( &_handlePrintFreq );
00177     commands( )->append( &_handlePrintLevel );
00178     commands( )->append( &_handlePrintLimit );
00179 }
00180 
00181 //--------------
00182 // Destructor --
00183 //--------------
00184 
00185 BdbTransactionMgr::~BdbTransactionMgr( )
00186 {
00187 }
00188 
00189 //-------------
00190 // Methods   --
00191 //-------------
00192 
00193 AppResult
00194 BdbTransactionMgr::beginJob( AbsEvent* anEvent )
00195 {
00196     if ( _verbose.value( ) ) {
00197       ErrMsg( trace ) << name()
00198                       << ": begin Job"
00199                       << endmsg;
00200     }
00201     return AppResult::OK ;
00202 }
00203 
00204 AppResult
00205 BdbTransactionMgr::beginRun( AbsEvent* anEvent )
00206 {
00207     if ( _verbose.value( ) ) {
00208       ErrMsg( trace ) << name()
00209                       << ": begin Run"
00210                       << endmsg;
00211     }
00212     return AppResult::OK ;
00213 }
00214 
00215 AppResult
00216 BdbTransactionMgr::event( AbsEvent* aEvent )
00217 {
00218 
00219    return( AppResult::OK ) ;
00220 }
00221 
00222 AppResult
00223 BdbTransactionMgr::endJob( AbsEvent* anEvent )
00224 {
00225     if ( _verbose.value( ) ) {
00226         ErrMsg( trace ) << name()
00227                       << ": end Job"
00228                       << endmsg;
00229     }
00230     return AppResult::OK ;
00231 }
00232 
00233 void
00234 BdbTransactionMgr::help( int argc, char** argv )
00235 {
00236     cout << endl;
00237 
00238     cout << "This module is " << name( ) << " and was thought to be able" << endl;
00239     cout << "to " << description( ) << " when it was added" << endl;
00240     cout << "to this executable." << endl << endl;
00241 
00242     cout << "In reality it is an input module for the BaBar Event Store." << endl;
00243     cout << "This version currently works only for the EmcGHit data &" << endl;
00244     cout << "assumes that that data is initially transient. It is therefore" << endl;
00245     cout << "a testbed for future development rather than an end product." << endl << endl;
00246 
00247     cout << "This module has one parameter, collectionName. This" << endl;
00248     cout << "specifies the collection name (for the current user) that will be" << endl;
00249     cout << "read." << endl;
00250     cout << endl;
00251 
00252     AppModule::help( argc, argv );
00253 }
00254 
00255 void
00256 BdbTransactionMgr::conditionalStart( BdbTransactionClient& client )
00257 {
00258    if( client.hasCommitted() ) {
00259       return ;
00260    }
00261 
00262    // open initial Conditions transaction is necessary
00263    BdbConditions& conditions( *BdbConditions::instance() ) ;
00264    if( ! conditions.transIsOpen() &&
00265        client.openInitialConTrans() ) {
00266       conditions.change( BdbcRead ,
00267                          d_True ) ;
00268       client.setOpenedInitialConTrans() ;
00269    }
00270 
00271    // open initial Configuration transaction is necessary
00272    BdbConfig& config( *BdbConfig::instance() ) ;
00273    if( ! config.transIsOpen() &&
00274        client.openInitialCfgTrans() ) {
00275       config.change( BdbcRead ,
00276                      d_True ) ;
00277       client.setOpenedInitialCfgTrans() ;
00278    }
00279 }
00280 
00281 bool
00282 BdbTransactionMgr::conditionalCheckPoint( BdbTransactionClient& client ,
00283                                           BdbCheckPointFunc& func )
00284 {
00285     BdbEventStore* theStore = BdbEventStore::instance( );
00286     bool result = false;
00287 
00288     // Output handle information is requested by the client
00289     if( 0 != client.handlePrintFrequency() ) {
00290        client.incrementHandlePrintCount() ;
00291        if( client.handlePrintFrequency() == client.handlePrintCount() ) {
00292           opiPrintHList( client.handlePrintLevel() ,
00293                          client.handlePrintLimit() ) ;
00294           client.resetHandlePrintCount() ;
00295        }
00296     }
00297 
00298     // Commit the transaction if the granularity threshold has been
00299     // exceeded. This threshold is determined by the granularity and 
00300     // granEvents parameters. The granEvents parameter determines
00301     // whether the units are events (true) or seconds (false). The
00302     // granularity parameter specifies the number of units (events or
00303     // seconds) for the threshold.
00304 
00305     if( ( client.granularityIsEvents() &&
00306           ( client.eventCount() >= client.granularity() ) ) ||
00307         ( ! client.granularityIsEvents() &&
00308           ( ((size_t) difftime( time( (time_t*)0 ), client.lastTime() )) >= client.granularity() ) ) ) {
00309 
00310         // Transaction granularity exceeded - commit this transaction
00311         if ( client.verboseOutput() ) {
00312             ErrMsg( routine ) << client.clientName()
00313                               << ": about to commit at "
00314                               << BdbTimeStamp( )
00315                               << endmsg;
00316         }
00317 
00318         BdbStatus checkPointResult( BdbcError ) ;
00319         if( 0 == client.commitAndHoldLimit() ) {
00320            BdbForceCommitAndStart commitAndStart( func ) ;
00321            checkPointResult = theStore->checkPoint( commitAndStart ) ;
00322         }
00323         else {
00324            if( client.commitAndHoldCount() >= client.commitAndHoldLimit() ) {
00325               BdbForceCommitAndStart commitAndStart( func ) ;
00326               checkPointResult = theStore->checkPoint( commitAndStart ) ;
00327               client.resetCommitAndHoldCount() ;
00328            }
00329            else {
00330               checkPointResult = theStore->checkPoint( func ) ;
00331               client.incrementCommitAndHoldCount() ;
00332            }
00333         }
00334         if ( BdbcSuccess != checkPointResult ) {
00335             ErrMsg( fatal ) << client.clientName()
00336                             << ": transaction checkpoint failed at "
00337                               << BdbTimeStamp( )
00338                               << " - Event: "
00339                             << client.totalEventCount()
00340                               << endmsg;
00341             ::abort( );
00342         }
00343         result = true;
00344         if ( client.verboseOutput() ) {
00345             ErrMsg( routine ) << client.clientName()
00346                               << ": transaction committed at "
00347                               << BdbTimeStamp( )
00348                               << " - Event: "
00349                               << client.totalEventCount()
00350                               << endmsg;
00351             ErrMsg( routine ) << client.clientName()
00352                               << ": new transaction started at "
00353                               << BdbTimeStamp( )
00354                               << endmsg;
00355         }
00356 
00357         if( ! client.hasCommitted() ) {
00358 
00359             // close initial Conditions transaction is necessary
00360             BdbConditions& conditions( *BdbConditions::instance() ) ;
00361             if( conditions.transIsOpen() &&
00362                 client.openedInitialConTrans() ) {
00363                 conditions.change( BdbcNoOpen ,
00364                                    d_True ) ;
00365             }
00366 
00367             // close initial Configuration transaction is necessary
00368             BdbConfig& config( *BdbConfig::instance() ) ;
00369             if( config.transIsOpen() &&
00370                 client.openedInitialCfgTrans() ) {
00371                 config.change( BdbcNoOpen ,
00372                                d_True ) ;
00373             }
00374         }
00375 
00376         // Reset counters & timers (and set 'hasCommitted')
00377         client.resetEventCount() ;
00378         client.resetLastTime() ;
00379     }
00380     return result;
00381 }
00382 
00383 bool
00384 BdbTransactionMgr::conditionalCheckPoint( APPInputModule& theModule ,
00385                                           BdbTransactionClient& client ,
00386                                           BdbCheckPointFunc& func )
00387 {
00388     client.incrementEventCount() ;
00389     client.inputLogged() ;
00390 
00391     bool result = false;
00392     // if first event has not been processed assume output is being logged.
00393     if ( ( ! ( client.loggingOutput() ) ) &&
00394          ( ( 0 != client.totalEventCount() ) &&
00395            ( 1 != client.totalEventCount() ) ) ) {
00396         result = conditionalCheckPoint( client ,
00397                                         func );
00398     }
00399     return result;
00400 }
00401 
00402 bool
00403 BdbTransactionMgr::conditionalCheckPoint( APPOutputModule& theModule ,
00404                                           BdbTransactionClient& client ,
00405                                           BdbCheckPointFunc& func )
00406 {
00407     if( ! client.loggingInput() ) {
00408        client.incrementEventCount() ;
00409     }
00410     client.outputLogged() ;
00411 
00412     return( conditionalCheckPoint( client ,
00413                                    func ) ) ;
00414 }
00415 
00416 //              -------------------------------------------
00417 //              -- Protected Function Member Definitions --
00418 //              -------------------------------------------
00419 
00420 void
00421 BdbTransactionMgr::prepareObjy( BdbTransactionClient& client )
00422 {
00423    BdbEventStore*  theStore = BdbEventStore::instance( );
00424    if ( ! theStore->oodbIsInitialized( ) ) {
00425 
00426       // Objectivity hasn't yet been initialized - do it now
00427       // Setup the Objectivity initial cache size (in pages). A value of 0
00428       // leaves the Objectivity default unchanged.
00429       d_ULong newValue = client.cacheInit( );
00430       if ( 0 < newValue ) {
00431          theStore->setCacheInitPages( newValue );
00432       }
00433       ErrMsg( routine ) << client.clientName( )
00434                         << ": Objectivity initial cache size set to "
00435                         << theStore->cacheInitPages( )
00436                         << " pages." << endmsg;
00437 
00438       // Setup the Objectivity maximum cache size (in pages). A value of 0
00439       // leaves the Objectivity default unchanged.
00440       newValue = client.cacheMax( );
00441       if ( 0 < newValue ) {
00442          theStore->setCacheMaxPages( newValue );
00443       }
00444       ErrMsg( routine ) << client.clientName( )
00445                         << ": Objectivity maximum cache size set to "
00446                         << theStore->cacheMaxPages( )
00447                         << " pages." << endmsg;
00448 
00449       // Setup the Objectivity number of file descriptors. A value of 0
00450       // leaves the Objectivity default unchanged.
00451       newValue = client.fileDescriptors( );
00452       if ( 0 < newValue ) {
00453          theStore->setFileDescriptors( newValue );
00454       }
00455       ErrMsg( routine ) << client.clientName( )
00456                         << ": Objectivity number of file descriptors set to "
00457                         << theStore->fileDescriptors( )
00458                         << endmsg;
00459 
00460       // Setup the RPC Timeout interval. However, don't reduce it unless the
00461       // new value is zero, in which case a 60sec timeout is established by default.
00462       d_ULong newRpc = client.rpcTimeout( );
00463       d_ULong oldRpc = theStore->rpcTimeout( );
00464       if ( 0 == newRpc ) {
00465          theStore->setRpcTimeout( 60 );
00466       } else {
00467          if ( newRpc > oldRpc ) {
00468             theStore->setRpcTimeout( newRpc );
00469          }
00470       }
00471       ErrMsg( routine ) << client.clientName( )
00472                         << ": RPC Timeout set to "
00473                         << theStore->rpcTimeout( )
00474                         << "secs." << endmsg;
00475 
00476       // Setup whether to check the VTable Pointers
00477       theStore->setCheckVTablePointer( client.checkVTablePointers( ) );
00478       if( theStore->isVTablePointerChecked() ) {
00479          ErrMsg( routine ) << client.clientName( )
00480                            << ": VTable Pointers are checked."
00481                            << endmsg;
00482       }
00483       else {
00484          ErrMsg( routine ) << client.clientName( )
00485                            << ": VTable Pointers are not checked."
00486                            << endmsg;
00487       }
00488    }
00489    else {
00490       ErrMsg( routine ) << client.clientName( )
00491                         << ": Objectivity is already initialized - "
00492                         << "initialization bypassed."
00493                         << endmsg;
00494    }
00495 }
00496 
00497 void
00498 BdbTransactionMgr::prepare( BdbTransactionClient& client )
00499 {
00500     BdbEventStore*  theStore = BdbEventStore::instance( );
00501     if ( ! client.isPrepared() ) {
00502 
00503         prepareObjy( client ) ;
00504 
00505 
00506         // Ensure that data is readable only by users who belong to the
00507         // eventstore domain
00508         theStore->startNestedRead() ;
00509         if ( ! theStore->isAccessAllowed( theStore->userName( ) ) ) {
00510             ErrMsg( fatal ) << "**************************************************" << endl
00511                             << "User " << theStore->userName( ) 
00512                             << ", you are not a registered user of the "            << endl
00513                             << "event store for this federation. Access is denied." << endl
00514                             << "**************************************************" << endmsg;
00515             theStore->abort( );
00516             ::abort( );
00517         }
00518         theStore->commitNested() ;
00519 
00520         if ( client.granularityIsEvents( ) ) {
00521             ErrMsg( routine ) << client.clientName( )
00522                               << ": Transaction granularity set to "
00523                               << client.granularity()
00524                               << " events."
00525                               << endmsg;
00526         } else {
00527             ErrMsg( routine ) << client.clientName( )
00528                               << ": Transaction granularity set to "
00529                               << client.granularity()
00530                               << " secs."
00531                               << endmsg;
00532         }
00533         client.setPrepared() ;
00534     }
00535 }
00536 
00537 bool
00538 BdbTransactionMgr::isPrepared() const
00539 {
00540    return( _isPrepared ) ;
00541 }
00542 
00543 int
00544 BdbTransactionMgr::cacheInit() const 
00545 {
00546    return( _cacheInit.value() ) ;
00547 }
00548 
00549 int
00550 BdbTransactionMgr::cacheMax() const 
00551 {
00552    return( _cacheMax.value() ) ;
00553 }
00554 
00555 int
00556 BdbTransactionMgr::fileDescriptors() const 
00557 {
00558    return( _fileDescriptors.value() ) ;
00559 }
00560 
00561 int
00562 BdbTransactionMgr::rpcTimeout() const 
00563 {
00564    return( _rpcTimeout.value() ) ;
00565 }
00566 
00567 bool
00568 BdbTransactionMgr::checkVTablePointers() const 
00569 {
00570    return( _checkVTablePointer.value() ) ;
00571 }
00572 
00573 
00574 bool
00575 BdbTransactionMgr::loggingInput() const
00576 {
00577    return( _loggingInput ) ;
00578 }
00579 
00580 bool
00581 BdbTransactionMgr::loggingOutput() const
00582 {
00583    return( _loggingOutput ) ;
00584 }
00585 
00586 const char*
00587 BdbTransactionMgr::clientName() const
00588 {
00589    return( name() ) ;
00590 }
00591 
00592 bool
00593 BdbTransactionMgr::verboseOutput() const
00594 {
00595    return( _verbose.value() ) ;
00596 }
00597 
00598 bool
00599 BdbTransactionMgr::granularityIsEvents() const
00600 {
00601    return( _granEvents.value() ) ;
00602 }
00603 
00604 size_t
00605 BdbTransactionMgr::granularity() const
00606 {
00607    if( 0 != _useGranularity ) {
00608       return( _useGranularity ) ;
00609    }
00610 
00611    // Setup the effective granularity counter. This is the
00612    // "granularity" value, unless the "granRandomize" flag is set
00613    // to true, in which the the effective granularity is the sum of
00614    // 1/2 the requested granularity plus (milisec of current time % requested
00615    // granularity). This adds a random component (albeit forming
00616    // constant effective granularity for each job) in the case of
00617    // multiple jobs. Note also that a requested granularity of zero
00618    // or less restores the original default.
00619    size_t valueToUse( _granularity.value() ) ;
00620    if ( 0 == valueToUse ) {
00621       valueToUse = 60;
00622    }
00623    if ( _granRandomize.value( ) ) {
00624       struct timeval tv;
00625       gettimeofday(&tv, 0);
00626       int delta = tv.tv_usec % valueToUse;
00627       valueToUse = valueToUse / 2;
00628       valueToUse += delta;
00629    }
00630    if ( valueToUse < 1 ) {
00631       valueToUse = 1;
00632    }
00633    const_cast< BdbTransactionMgr* >( this )->_useGranularity = valueToUse ;
00634 
00635    return( _useGranularity ) ;
00636 }
00637 
00638 size_t
00639 BdbTransactionMgr::eventCount() const
00640 {
00641    return( _granularityCount ) ;
00642 }
00643 
00644 size_t
00645 BdbTransactionMgr::totalEventCount() const
00646 {
00647    return( _totalCount ) ;
00648 }
00649 
00650 time_t
00651 BdbTransactionMgr::lastTime() const
00652 {
00653    return( _lastTime ) ;
00654 }
00655 
00656 bool
00657 BdbTransactionMgr::hasCommitted() const
00658 {
00659    return( _hasCommitted ) ;
00660 }
00661 
00662 size_t
00663 BdbTransactionMgr::commitAndHoldLimit() const
00664 {
00665    return( _commitAndHoldLimit.value() ) ;
00666 }
00667 
00668 size_t
00669 BdbTransactionMgr::commitAndHoldCount() const
00670 {
00671    return( _commitAndHoldCount ) ;
00672 }
00673 
00674 bool
00675 BdbTransactionMgr::openInitialConTrans() const
00676 {
00677    return( _openInitialConTrans.value() ) ;
00678 }
00679 
00680 bool
00681 BdbTransactionMgr::openedInitialConTrans() const
00682 {
00683    return( _openedInitialConTrans ) ;
00684 }
00685 
00686 bool
00687 BdbTransactionMgr::openInitialCfgTrans() const
00688 {
00689    return( _openInitialCfgTrans.value() ) ;
00690 }
00691 
00692 bool
00693 BdbTransactionMgr::openedInitialCfgTrans() const
00694 {
00695    return( _openedInitialCfgTrans ) ;
00696 }
00697 
00698 size_t
00699 BdbTransactionMgr::handlePrintFrequency() const 
00700 {
00701    return( _handlePrintFreq.value() ) ;
00702 }
00703 
00704 size_t
00705 BdbTransactionMgr::handlePrintCount() const 
00706 {
00707    return( _handlePrintCount ) ;
00708 }
00709 
00710 size_t
00711 BdbTransactionMgr::handlePrintLevel() const 
00712 {
00713    return( _handlePrintLimit.value() ) ;
00714 }
00715 
00716 size_t
00717 BdbTransactionMgr::handlePrintLimit() const 
00718 {
00719    return( _handlePrintLimit.value() ) ;
00720 }
00721 
00722 void
00723 BdbTransactionMgr::setPrepared()
00724 {
00725    _isPrepared = true ;
00726 }
00727 
00728 void
00729 BdbTransactionMgr::inputLogged()
00730 {
00731    _loggingInput = true ;
00732 }
00733 
00734 void
00735 BdbTransactionMgr::outputLogged()
00736 {
00737    _loggingOutput = true ;
00738 }
00739 
00740 void
00741 BdbTransactionMgr::incrementEventCount()
00742 {
00743    _totalCount++ ;
00744    _granularityCount++ ;
00745 }
00746 
00747 void
00748 BdbTransactionMgr::resetEventCount()
00749 {
00750    _hasCommitted = true ;
00751    _granularityCount = 0 ;
00752 }
00753 
00754 void
00755 BdbTransactionMgr::resetLastTime()
00756 {
00757    _hasCommitted = true ;
00758    _lastTime =  time( (time_t*)0 ) ;
00759 }
00760 
00761 void
00762 BdbTransactionMgr::incrementCommitAndHoldCount()
00763 {
00764    _commitAndHoldCount++ ;
00765 }
00766 
00767 void
00768 BdbTransactionMgr::resetCommitAndHoldCount()
00769 {
00770    _commitAndHoldCount = 0 ;
00771 }
00772 
00773 void
00774 BdbTransactionMgr::setOpenedInitialConTrans()
00775 {
00776    _openedInitialConTrans = !false ;
00777 }
00778 
00779 void
00780 BdbTransactionMgr::setOpenedInitialCfgTrans()
00781 {
00782    _openedInitialCfgTrans = !false ;
00783 }
00784 
00785 void
00786 BdbTransactionMgr::incrementHandlePrintCount()
00787 {
00788    _handlePrintCount++ ;
00789 }
00790 
00791 void
00792 BdbTransactionMgr::resetHandlePrintCount()
00793 {
00794    _handlePrintCount = 0 ;
00795 }

 


BaBar Public Site | SLAC | News | Links | Who's Who | Contact Us

Page Owner: Jacek Becla
Last Update: October 04, 2002