DBCP connection pooling exhausted - JDBC JAVA
This is a discussion on DBCP connection pooling exhausted - JDBC JAVA ; Hi,
In my application iam using ibatis for db connection.
data source using as dbcp.
sometimes, Iam getting the following error.
--------------------------------------------------------------------------------
java.sql.SQLException: DBCP could not obtain an idle db connection,
pool exhausted
at com.nobrokerage.login.NBHomeImpl.execute(NBHomeImpl.java:55)
at com.nobrokerage.login.LoginAction.execute(LoginAction.java:35)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:
484)
...
-
DBCP connection pooling exhausted
Hi,
In my application iam using ibatis for db connection.
data source using as dbcp.
sometimes, Iam getting the following error.
--------------------------------------------------------------------------------
java.sql.SQLException: DBCP could not obtain an idle db connection,
pool exhausted
at com.nobrokerage.login.NBHomeImpl.execute(NBHomeImpl.java:55)
at com.nobrokerage.login.LoginAction.execute(LoginAction.java:35)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:
484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:
1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:
507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
269)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
188)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
174)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
117)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
108)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
174)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:
200)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:
703)
at org.apache.jk.common.ChannelSocket
$SocketConnection.runIt(ChannelSocket.java:895)
at org.apache.tomcat.util.threads.ThreadPool
$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595)
--------------------------------------------------------------------------------
Here is the sqlMapConfig.xml
--------------------------------------------------------------------------------
<settings maxExecute="400" maxExecutePerConnection="5"
maxTransactions="30" statementCacheSize="150" />
<!-- Configure a datasource to use with this SQL Map using Jakarta
DBCP
notice the use of the properties from the above resource -->
<datasource name="basic" default = "true" factory-
class="com.ibatis.db.sqlmap.datasource.DbcpDataSourceFactory">
<property name="JDBC.Driver" value="${driver}"/>
<property name="JDBC.ConnectionURL" value="${url}"/>
<property name="JDBC.Username" value="${username}"/>
<property name="JDBC.Password" value="${password}"/>
<property name="Pool.MaximumActiveConnections" value="10"/>
<property name="Pool.MaximumIdleConnections" value="5"/>
<property name="Pool.MaximumWait" value="60000"/>
</datasource>
--------------------------------------------------------------------------------
Is active and idle connections value has to increase ?
Can anybody tell me, what is the cause for this error.
-
Re: DBCP connection pooling exhausted
itmohan2002@gmail.com wrote:
> In my application iam using ibatis for db connection.
> data source using as dbcp.
> sometimes, Iam getting the following error.
>
> --------------------------------------------------------------------------------
> java.sql.SQLException: DBCP could not obtain an idle db connection,
> pool exhausted
> at com.nobrokerage.login.NBHomeImpl.execute(NBHomeImpl.java:55)
> at com.nobrokerage.login.LoginAction.execute(LoginAction.java:35)
> at
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:
> 484)
> Here is the sqlMapConfig.xml
>
> --------------------------------------------------------------------------------
> <settings maxExecute="400" maxExecutePerConnection="5"
> maxTransactions="30" statementCacheSize="150" />
> <!-- Configure a datasource to use with this SQL Map using Jakarta
> DBCP
> notice the use of the properties from the above resource -->
> <datasource name="basic" default = "true" factory-
> class="com.ibatis.db.sqlmap.datasource.DbcpDataSourceFactory">
> <property name="JDBC.Driver" value="${driver}"/>
> <property name="JDBC.ConnectionURL" value="${url}"/>
> <property name="JDBC.Username" value="${username}"/>
> <property name="JDBC.Password" value="${password}"/>
> <property name="Pool.MaximumActiveConnections" value="10"/>
> <property name="Pool.MaximumIdleConnections" value="5"/>
> <property name="Pool.MaximumWait" value="60000"/>
> </datasource>
>
> --------------------------------------------------------------------------------
> Is active and idle connections value has to increase ?
> Can anybody tell me, what is the cause for this error.
First check whether you get the connection (or whatever iBatis offer)
closed everywhere.
Then try and increase those values.
Arne