Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.2
-
None
Description
When a PooledConnectionFactory is stopped, ObjectPools created by the SessionPools aren't closed, and therefore PooledSessions remain running. Since the underlying ActiveMQSession isn't actually closed when the PooledSession is closed, the ActiveMQSessionExecutor and its worker threads are never stopped. I added a method to PooledConnection called "destroyPools" which will close the ObjectPools associated with a connection. The differences are pasted below.
diff oldpool/PooledConnection.java pool/PooledConnection.java
21a22
> import java.util.Iterator;
154a156,163
> protected void destroyPools() {
> Iterator i = cache.values().iterator();
> while (i.hasNext())
> }
diff oldpool/PooledConnectionFactory.java pool/PooledConnectionFactory.java
95a96
> connection.destroyPools();
diff oldpool/SessionPool.java pool/SessionPool.java
98c98,104
<
—
> protected void close() {
> if (sessionPool != null) {
> try
catch (Exception e) {}
> }
> }