MongoDB  2.4.4-pre-
Classes | Public Member Functions | List of all members
mongo::DBConnectionPool Class Reference

Database connection pool. More...

#include <connpool.h>

Inheritance diagram for mongo::DBConnectionPool:
mongo::PeriodicTask

Classes

struct  serverNameCompare
 compares server namees, but is smart about replica set names More...
 

Public Member Functions

void setName (const string &name)
 right now just controls some asserts. More...
 
void onCreate (DBClientBase *conn)
 
void onHandedOut (DBClientBase *conn)
 
void onDestroy (DBClientBase *conn)
 
void flush ()
 
DBClientBaseget (const string &host, double socketTimeout=0)
 
DBClientBaseget (const ConnectionString &host, double socketTimeout=0)
 
void release (const string &host, DBClientBase *c)
 
void addHook (DBConnectionHook *hook)
 
void appendInfo (BSONObjBuilder &b)
 
void clear ()
 Clears all connections for all host.
 
bool isConnectionGood (const string &host, DBClientBase *conn)
 Checks whether the connection for a given host is black listed or not. More...
 
void removeHost (const string &host)
 
virtual string taskName () const
 
virtual void taskDoWork ()
 

Additional Inherited Members

- Static Public Attributes inherited from mongo::PeriodicTask
static RunnertheRunner = 0
 

Detailed Description

Database connection pool.

Generally, use ScopedDbConnection and do not call these directly.

This class, so far, is suitable for use with unauthenticated connections. Support for authenticated connections requires some adjustments: please request...

Usage:

{ ScopedDbConnection c("myserver"); c.conn()... }

Member Function Documentation

bool mongo::DBConnectionPool::isConnectionGood ( const string &  host,
DBClientBase conn 
)

Checks whether the connection for a given host is black listed or not.

Parameters
hostNamethe name of the host the connection connects to.
connthe connection to check.
Returns
true if the connection is not bad, meaning, it is good to keep it for future use.
void mongo::DBConnectionPool::setName ( const string &  name)
inline

right now just controls some asserts.

defaults to "dbconnectionpool"


The documentation for this class was generated from the following files: