Oracle Objects for OLE C++ Class Library
Release 9.2

Part Number A95896-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
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 © 1998, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback