No more Java connections can be set up to MDS
This article talks about how to handle a connectivity problem from a front-end Java EE application to MDS.
You use CRM E-commerce, SRM MDM Catalog, MDM EC, or other Java EE applications, for which MDM Connector is used to set up the physical connection to MDS.
When you access any Java link, you get an error message saying:” HTTP 500, connection timed out”, or “page cannot be loaded”, although you have the backend repository up and running, and the same configuration has been working ok.
In the default trace, you find an error like:
Cannot create JCA connection. Cause exception: Cannot get connection for 120 seconds. Possible reasons: 1) Connections are cached within SystemThread(can be any server service or any code invoked within SystemThread in the SAP J2EE Engine) or they are allocated from a non transactional ConnectionFactory. In case of transactional ConnectionFactory used from Application Thread there is an automatic mechanism which detects unclosed connections, 2)The pool size of adapter "MDM Factory" is not enough according to the current load of the system. In case 1) the solution is to check for cached connections using the Connector Service list_conns command or in case 2), to increase the size of the pool.
As a system administration task, you can log into VA or NWA (depending on the java version) checking the current connection related parameters and decide if there is indeed a connection leakage problem:
UsedManagedConnectionsCount - Returns the count of currently used managed connections.
FreeManagedConnectionsCount - The count of all available managed connections.
ManagedConnectionsUsageRate - Ratio(percent) between the used and maximum managed connections number for the connection pool of a specific connection factory.
MaxManagedConnectionsNumber - Connection pool maximum size.
WaitingForManagedConnectionCount - The count of clients waiting for a managed connection.
OpenedManagedConnectionsCount - Shows how many managed connections are opened per application (Table).
TimedOutConnectionRequests - The aggregated number of failed getConnection() requests, due to a heavy connection pool usage.
SAP Note 1822443 talks about how to get these values.
To troubleshoot for possible solutions, follow the steps below:
1, SAP Note 1821867 is released for a known problem on accumulation of connections in java connection pool. The used connections are not released, connection count reaches the maximum value (default 1000), and no new connection can be set up. You may first check if this note applies.
2, if step 1 doesn’t solve the problem, then increase the value of parameters:
Maximum Waiting Time for Connections = 120sec (default) << the waiting time for connection open
Maximum Connections = 1000(default) <<< the pool size
for resource adapter "MDM Factory".
3, if you still have this issue after increasing these values, you can use the “switch_debug_mode” and “list_conns” telnet commands. Run “list_conns” at a regular basis, so that you can find what is leaking the connections before the pool gets exhausted. More details are documented in SAP Note 719778.
1822443 - Connection pool parameters on different Net Weaver versions
1821867 - Accumulation of MDM connections in connection pool
719778 – DataSource fails to return connection