Using java/Spring/Ibatis sqlserver is the database and datasource is org.apache.commons.dbcp.BasicDataSource following is the source object
<bean id="wssModelDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="net.sourceforge.jtds.jdbcx.JtdsDataSource"/>
<property name="url" value="com.wss.jdbc.ConnectionUrl=jdbc:jtds:sqlserver://x-x2/x_control_QA;appName=wss;sendStringParametersAsUnicode=false;loginTimeout=20;socketTimeout=180"/>
<property name="username" value="xxx"/>
<property name="password" value="xxx"/>
<property name="maxActive" value="10"/>
<property name="maxWait" value="10000"/>
</bean>
In the log file we found following exception.
--- Cause: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object]
Stack trace as follows
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, general error
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:118)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)
at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy.invoke(TransactionAwareDataSourceProxy.java:210)
at .prepareStatement(Unknown Source)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.prepareStatement(SqlExecutor.java:494)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:176)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
... 196 more
Caused by: java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1112)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
... 204 more
2012-10-15 04:29:57,258 [Thread-2] INFO [ConnectionManagerImpl.java:58] : user[] Stopping managed instances...
2012-10-15 04:29:57,444 [http-bio-8000-exec-81187] INFO [LoggingInterceptor.java:42] : user[] uri[/wss/security/login_submit.html] took[6.612] seconds
2012-10-15 04:29:57,451 [http-bio-8000-exec-81182] ERROR [LoginSubmitAction.java:121] : user[] Exception logging in[
--- The error occurred in ibatis/control_core.xml.
--- The error occurred while executing query.
I am trying to reproduce this error using Jmeter http login request with user credentials as params which let me login successfully which in result makes the call to DAO layer from controller.
But problem is i have tried with 3 Jmeter instances running forever loop 100 threads but it did not reproduce the issue ? any quick idea how can i reproduce the problem ?
I have reproduced this error using Jmeter i created httprequest request login parameters and initiated 5 JMeter instances. and finally able to reproduce this issue.