I've been playing around with closing the connection pools... I added this into
ApacheDsDataProvider and call it when the war shuts down, however it doesn't
solve the problem. Is this the correct location and way to close the pools?
public static void closeAllConnectionPools(){
try {
LOG.info("Admin pool active: " + adminPool.getNumActive());
LOG.info("Admin pool idle: " + adminPool.getNumIdle());
adminPool.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
LOG.info("User pool active: " + userPool.getNumActive());
LOG.info("User pool idle: " + userPool.getNumIdle());
userPool.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
LOG.info("Log pool active: " + logPool.getNumActive());
LOG.info("Log pool idle: " + logPool.getNumIdle());
logPool.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
----- Original Message -----
From: "Shawn McKinney" <[email protected]>
To: [email protected]
Sent: Friday, March 4, 2016 10:14:59 AM
Subject: Re: LDAP Connection Management
> On Mar 3, 2016, at 9:27 PM, Kiran Ayyagari <[email protected]> wrote:
>
> my guess is that there is a connection pool in use here, and it is not
> properly destroyed while the app
> is being unloaded from the app server.
>
> Did you try closing the pool in your app's ServletContextListener?
Kiran, thanks for jumping in here. Short answer is no we’re not capturing
termination events and properly destroying the pool. Shouldn’t be a hard to
do, but we’ll prolly have to open an api to the client as the pool isn’t
currently accessible - publicly.
Shawn