org.apache.commons.dbcp

Class AbandonedObjectPool


public class AbandonedObjectPool
extends GenericObjectPool

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

Object
borrowObject()
Get a db connection from the pool.
void
invalidateObject(Object obj)
Invalidates an object from the pool.
void
returnObject(Object obj)
Return a db connection to the pool.

Constructor Details

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 Details

borrowObject

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

invalidateObject

public void invalidateObject(Object obj)
            throws Exception
Invalidates an object from the pool.
Parameters:
obj - object to be returned

returnObject

public void returnObject(Object obj)
            throws Exception
Return a db connection to the pool.
Parameters:
obj - db Connection to return

Copyright © 2001-2004 Apache Software Foundation. Documenation generated June 19 2007.