wso2 / wso2-axis2-transports

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Properly closing the connections in the pool when there are issues with any connection

malinthaprasan opened this issue · comments

Description:
The code in [1] only clears the map which holds JMS connections when there are any issues with connections. We need to close individual connections as well. Otherwise, those connections will be kept as it is at the JMS server side and consume resources.

    /**
     * Clear the shared connection map due to stale connections
     */
    private synchronized void clearSharedConnections() {
        sharedConnectionMap.clear();
        lastReturnedConnectionIndex = 0;
    }

[1] https://github.com/wso2/wso2-axis2-transports/blob/v2.0.0-wso2v18/modules/jms/src/main/java/org/apache/axis2/transport/jms/JMSConnectionFactory.java#L565-L568