Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DbiConnectionMaintainer.cxx

Go to the documentation of this file.
00001 // $Id: DbiConnectionMaintainer.cxx,v 1.1 2005/06/06 16:55:31 west Exp $
00002 
00003 
00004 #include "DatabaseInterface/DbiCascader.h"
00005 #include "DatabaseInterface/DbiConnectionMaintainer.h"
00006 #include "LeakChecker/Lea.h"
00007 #include "MessageService/MsgService.h"
00008 
00009 ClassImp(DbiConnectionMaintainer)
00010 
00011 //   Definition of static data members
00012 //   *********************************
00013 
00014 CVSID("$Id: DbiConnectionMaintainer.cxx,v 1.1 2005/06/06 16:55:31 west Exp $");
00015 
00016 
00017 DbiConnectionMaintainer::DbiConnectionMaintainer(DbiCascader* cascader) {
00018 
00019 // For database connections that are not permanent, the connection is
00020 // closed as soon as the last associated DbiStatement is
00021 // deleted. However, standard context queries involve several separate
00022 // SQL queries, each using its own DbiStatement and hence each involving
00023 // a separate connection.  To maintain a single connection for the entire
00024 // set of SQL queries a DbiConnectionMaintainer can be use.  On creation
00025 // it connects to every DbiConnection which prevents it from closing.  On
00026 // destruction it disconnects from them allowing them to close, if
00027 // temporary, once any other associated DbiStatement has been deleted.
00028 
00029   LEA_CTOR    //Leak Checker
00030 
00031   MSG("Dbi", Msg::kVerbose) << "Creating DbiConnectionMaintainer" << endl;
00032 
00033   fCascader = cascader;
00034   if ( fCascader ) fCascader->HoldConnections();
00035 
00036 }
00037 //.....................................................................
00038 
00039 
00040 DbiConnectionMaintainer::~DbiConnectionMaintainer() {
00041 
00042   if ( fCascader ) fCascader->ReleaseConnections();
00043 
00044   LEA_DTOR    //Leak Checker
00045 
00046   MSG("Dbi", Msg::kVerbose) << "Destroying DbiConnectionMaintainer" << endl;
00047 
00048 }
00049 
00050 /*    Template for New Member Function
00051 
00052 //.....................................................................
00053 
00054 DbiConnectionMaintainer:: {
00055 //
00056 //
00057 //  Purpose:  
00058 //
00059 //  Arguments: 
00060 //    xxxxxxxxx    in    yyyyyy
00061 //
00062 //  Return:    
00063 //
00064 //  Contact:   N. West
00065 //
00066 //  Specification:-
00067 //  =============
00068 //
00069 //  o 
00070 
00071 //  Program Notes:-
00072 //  =============
00073 
00074 //  None.
00075 
00076 
00077 }
00078 
00079 */
00080 

Generated on Mon Feb 15 11:06:34 2010 for loon by  doxygen 1.3.9.1