I'm currently working on a project which was originally not build for high load.
My problem atm is that at some point during the stress test (30 users) the application seems to "get stuck" and when it releases it spits out a lot of exceptions. Unable to get managed connection for [MY_DS]
When I run only one user, it works like a charm so it has something to do with the concurrency. I also checked if there were any unclosed DB connections at the end of one run and there were none, so at normal usage, there are no connection leaks.
My suspicion goes out to my open and close methods (because they are static). Here are the methods:
public static Connection getConnection() {
if (logger.isDebugEnabled()) logger.debugLog("getConnection()");
try {
return DSUtils.getDefaultDataSource().getConnection();
} catch (SQLException se) {
logger.errorLog("SQLException", se);
throw new ApplicationRuntimeException(MessageCodesConstants.ERROR_SQL_EXCEPTION, se);
}
}
public static void closeConnection(Connection con) {
if (logger.isDebugEnabled()) logger.debugLog("closeConnection");
try {
if (con != null) {
con.close();
}
} catch (SQLException se) {
logger.warnLog("SQLException while closing connection");
}
}
It is an EE application running on JBoss EAP 6.2.0 backed-up by a SQL Server 2008.
Can somebody point me in the right direction to find out where the solution can be found?