Oracle Objects for OLE C++ Class Library
Release 9.0.1

Part Number A90172-01

Home

Book List

Contents

Master Index

Feedback

RemoveFromPool Method

Applies To

ODatabase

Description

This method removes the database from the pool.

Usage

oresult RemoveFromPool(void) const

Arguments

none

Remarks

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

}


 
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.

Home

Book List

Contents