Brandon:
After Working with my fw-admin here, He fixed that problem (tcp connections being timed out) quite a while ago. We did not experience that for a while. Now, it was resurfacing again. So, I downloaded the source code from
http://www.dahbura.com/ldap/, who is the original author of the ConnectionPool: the code you download from his source has some other functions such as refreshing your pool after periodic interval. I set this interval to be every 3 hrs, and I found that some of those unused connections go dead and they get refreshed.
However, you can check right before giving the connection object whether it is connected or not by adding the following code segment inside the function "protected LDAPConnection getConnFromPool()":
if ( ldapconnobj != null )
{
con = ldapconnobj.getLDAPConn();
/*start->Added segment*******************/
if ( !con.isConnected() )
{
System.out.println
( "connection (while retrieving connection) is not connected, attempting reconnect before handoff." );
try {
con.reconnect();
//reset the ldapconnobj's LDAPConnection parameter
ldapconnobj.setLDAPConn( con );
//reset the pool's ldapconnobj parameter
pool.set( i,ldapconnobj );
} catch (LDAPException e) {
debug("Unable to reconnect - server is probably down");
}
System.out.println( "reconnect succeeded." );
}
/*end->Added segment*******************/
}
This will reconnect right before
Right now, I am still working with my fw-admin on finding out why some of those connections get disconnected every now and then.