Oracle® Objects for OLE C++ Class Library Developer's Guide 10g Release 1 (10.1) Part Number B10119-01 |
|
Applies To
Description
This method removes the database from the pool.
Usage
oresult RemoveFromPool(void) const
Arguments
none |
This method applies only to those ODatabase objects which are retrieved from the pool using a ODatabase::GetDatabaseFromPool. This method is particularly useful for removing ODatabase objects from the pool whose connections are no longer valid.
Return Value
An oresult indicating whether the operation succeeded (OSUCCESS) or not (OFAILURE).
Example
This example creates a pool of 2 connections with a maximum of 10 connections, and then gets a database from the pool.
OSession osess;
osess.Open();
osess.CreateDatabasePool(2,10,200, "Exampledb", "scott", "tiger",
ODATABASE_DEFAULT);
odb = sess1.GetDatabaseFromPool(5000); //Get database from pool
oresult ores= odb.ExecuteSQL("drop table dontwantit");
if (ores == OFAILURE )
{
if (odb.ServerErrorNumber != 0) //there was a server error
odb.RemoveFromPool();
odb = sess1.GetDatabaseFromPool(5000); //Get database
}