You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Leandro Rodrigo Saad Cruz <le...@ibnetwork.com.br> on 2004/01/22 15:27:45 UTC

Testing old connections on ConnectionFactoryDBCPImpl

Hi all. I'm not sure how to test if the ConnectionFactoryDBCPImpl
is closing the connection after the configured timeout.

my conf is :

<connection-pool logAbandoned="true" 
		removeAbandoned="true" 
		removeAbandonedTimeout="5"/>

Is this code right ?

public void testGetConnection() 
    	throws Exception
{
    ConnectionManagerIF manager = broker.serviceConnectionManager();
    Connection con = manager.getConnection();
    assert(!con.isClosed());
    Thread.sleep(6000);
    assertTrue(con.isClosed());
}
-- 
Leandro Rodrigo Saad Cruz
IT - Inter Business Tecnologia e Servicos (IB)
http://www.ibnetwork.com.br
http://db.apache.org/ojb
http://xingu.sourceforge.net



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org