Oracle Objects for OLE C++ Class Library
Release 8.1.7

Part Number A85258-01

Library

Product

Contents

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 copy; 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents