org.apache.commons.dbcp

Class AbandonedObjectPool

public class AbandonedObjectPool extends GenericObjectPool

Deprecated: This will be removed in a future version of DBCP.

An implementation of a Jakarta-Commons ObjectPool which tracks JDBC connections and can recover abandoned db connections. If logAbandoned=true, a stack trace will be printed for any abandoned db connections recovered.

Version: $Revision: 482015 $ $Date: 2006-12-03 19:22:09 -0700 (Sun, 03 Dec 2006) $

Author: Glenn L. Nielsen

Constructor Summary
AbandonedObjectPool(PoolableObjectFactory factory, AbandonedConfig config)
Create an ObjectPool which tracks db connections.
Method Summary
ObjectborrowObject()
Get a db connection from the pool.
voidinvalidateObject(Object obj)
Invalidates an object from the pool.
voidreturnObject(Object obj)
Return a db connection to the pool.

Constructor Detail

AbandonedObjectPool

public AbandonedObjectPool(PoolableObjectFactory factory, AbandonedConfig config)
Create an ObjectPool which tracks db connections.

Parameters: factory PoolableObjectFactory used to create this config configuration for abandoned db connections

Method Detail

borrowObject

public Object borrowObject()
Get a db connection from the pool. If removeAbandoned=true, recovers db connections which have been idle > removeAbandonedTimeout and getNumActive() > getMaxActive() - 3 and getNumIdle() < 2

Returns: Object jdbc Connection

Throws: Exception if an exception occurs retrieving a connection from the pool

invalidateObject

public void invalidateObject(Object obj)
Invalidates an object from the pool.

Parameters: obj object to be returned

Throws: Exception if an exception occurs invalidating the object

returnObject

public void returnObject(Object obj)
Return a db connection to the pool.

Parameters: obj db Connection to return

Throws: Exception if an exception occurs returning the connection to the pool

Copyright © 2001-2004 Apache Software Foundation. Documenation generated December 10 2007.