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

DbiConnectionMaintainer Class Reference

Concept An object that hold open all DbiConnections throught its lifetime. Purpose To minimse the number of connections made and broken when performing multiple SQL queries. More...

#include <DbiConnectionMaintainer.h>

List of all members.

Public Member Functions

 DbiConnectionMaintainer (DbiCascader *cascader=0)
virtual ~DbiConnectionMaintainer ()

Private Attributes

DbiCascaderfCascader
 May be null if made by (useless) default ctor.


Detailed Description

Concept An object that hold open all DbiConnections throught its lifetime. Purpose To minimse the number of connections made and broken when performing multiple SQL queries.

Id
DbiConnectionMaintainer.h,v 1.2 2006/08/08 10:51:32 west Exp

DatabaseInterface

Contact: n.west1@physics.ox.ac.uk

Definition at line 27 of file DbiConnectionMaintainer.h.


Constructor & Destructor Documentation

DbiConnectionMaintainer::DbiConnectionMaintainer DbiCascader cascader = 0  ) 
 

Definition at line 17 of file DbiConnectionMaintainer.cxx.

References LEA_CTOR, and MSG.

00017                                                                       {
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 }

DbiConnectionMaintainer::~DbiConnectionMaintainer  )  [virtual]
 

Definition at line 40 of file DbiConnectionMaintainer.cxx.

References fCascader, LEA_DTOR, MSG, and DbiCascader::ReleaseConnections().

00040                                                   {
00041 
00042   if ( fCascader ) fCascader->ReleaseConnections();
00043 
00044   LEA_DTOR    //Leak Checker
00045 
00046   MSG("Dbi", Msg::kVerbose) << "Destroying DbiConnectionMaintainer" << endl;
00047 
00048 }


Member Data Documentation

DbiCascader* DbiConnectionMaintainer::fCascader [private]
 

May be null if made by (useless) default ctor.

Definition at line 42 of file DbiConnectionMaintainer.h.

Referenced by ~DbiConnectionMaintainer().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:09:02 2010 for loon by  doxygen 1.3.9.1