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  

/BdbCondAdmin/BdbCondTransRead.cc

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //
00003 // File and Version Information:
00004 //      $Id: BdbCondTransRead.cc,v 1.1 1999/07/17 03:38:45 gapon Exp $
00005 //
00006 // Description:
00007 //      Class BdbCondTransRead. This class implements a read mode
00008 //      transactions management.
00009 //
00010 // Environment:
00011 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00012 //
00013 // Author List:
00014 //      Igor A. Gaponenko           Original Author
00015 //
00016 // Copyright Information:
00017 //      Copyright (C) 1999          Lawrence Berkeley Laboratory
00018 //
00019 //-----------------------------------------------------------------------------
00020 
00021 //-----------------------
00022 // This Class's Header --
00023 //-----------------------
00024 
00025 #include "BdbCondAdmin/BdbCondTransRead.hh"
00026 
00027 //-------------------------------
00028 // Collaborating Class Headers --
00029 //-------------------------------
00030 
00031 #include "ErrLogger/ErrLog.hh"
00032 #include "BdbCond/BdbConditions.hh"
00033 
00034 //-----------------------------------------------------------------------
00035 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
00036 //-----------------------------------------------------------------------
00037 
00038 static const char rscid[] = "$Id: BdbCondTransRead.cc,v 1.1 1999/07/17 03:38:45 gapon Exp $";
00039 
00040 //----------------
00041 // Constructors --
00042 //----------------
00043 
00044 BdbCondTransRead::BdbCondTransRead( ) :
00045     BdbCondTrans( )
00046 {
00047 }
00048 
00049 //--------------
00050 // Destructor --
00051 //--------------
00052 
00053 BdbCondTransRead::~BdbCondTransRead( )
00054 {
00055 }
00056 
00057 //--------------
00058 // Operations --
00059 //--------------
00060 
00061 BdbStatus
00062 BdbCondTransRead::start( )
00063 {
00064     if( isActive( )) {
00065         ErrMsg(error) << "BdbCondTransRead::start() -- ERROR." << endl
00066                       << "    Transaction is already active." << endl
00067                       << "    Check the logic of the application." << endmsg;
00068         return BdbcError;
00069     }
00070     setActive( true );
00071 
00072     return BdbConditions::instance( )->startRead();
00073 }
00074 
00075 BdbStatus
00076 BdbCondTransRead::commit( )
00077 {
00078     if( ! isActive( )) {
00079         ErrMsg(error) << "BdbCondTransRead::commit() -- ERROR." << endl
00080                       << "    Transaction is not active." << endl
00081                       << "    Check the logic of the application." << endmsg;
00082         return BdbcError;
00083     }
00084     setActive( false );
00085 
00086     return BdbConditions::instance( )->commit();
00087 }
00088 
00089 BdbStatus
00090 BdbCondTransRead::abort( )
00091 {
00092     if( ! isActive( )) {
00093         ErrMsg(error) << "BdbCondTransRead::abort() -- ERROR." << endl
00094                       << "    Transaction is not active." << endl
00095                       << "    Check the logic of the application." << endmsg;
00096         return BdbcError;
00097     }
00098     setActive( false );
00099 
00100     return BdbConditions::instance( )->abort();
00101 }
00102 
00103 /////////////////
00104 // End Of File //
00105 /////////////////

 


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

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