commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <phil.ste...@gmail.com>
Subject Re: [dbcp] GenericObjectPool.borrowObject() hangs
Date Fri, 06 Mar 2009 02:37:41 GMT
Arun Karthik wrote:
> Hi,
>
> Occasionally when the DB is taken down for maintenance my server hangs with jmap similar
to below:
> I am not able to reproduce the same when I try to unplug the DB machine's network cable
or any other way I could think ok.
> Could someone please guide me as to what the problem may  be.
>   

Can you provide the pool configuration settings - maxActive, maxWait, 
testOnBorrow, etc.?   Also, are you sure *all* of the threads are 
blocked in this state.  From the line numbers in the trace, it looks 
like you have maxWait set to a negative value, meaning that threads will 
block indefinitely waiting for connections to become available.  The 
thread in the dump below is doing that - waiting for a connection to 
become available.  

Phil
> I am using
>
> 1.       quartz scheduler
>
> 2.       commons-dbcp-1.2.1
>
> 3.       commons-pool-1.2
>
> 4.       Oracle RAC DB with thin client
>
> 5.       ojdbc14.jar
>
> The Quartz Scheduler internally creates a Connection Pool and uses the connection details
like URL, UserID, PWD and maxConnections, and validateQuery parameters/settings
>
> org.quartz.dataSource.lclDS.URL=jdbc:oracle:thin:@dbsrv:1521:XE
> org.quartz.dataSource.lclDS.user=uname
> org.quartz.dataSource.lclDS.password=pwd
> org.quartz.dataSource.lclDS.driver=oracle.jdbc.OracleDriver
> org.quartz.dataSource.lclDS.maxConnections=1
> org.quartz.dataSource.lclDS.validationQuery=select 1 from dual
>
> ---------------------------------------- thread dump--------------------------------------------------
> Thread 19804: (state = BLOCKED)
>  - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be imprecise)
>  - java.lang.Object.wait() @bci=2, line=485 (Interpreted frame)
>  - org.apache.commons.pool.impl.GenericObjectPool.borrowObject() @bci=121, line=748 (Interpreted
frame)
>  - org.apache.commons.dbcp.PoolingDataSource.getConnection() @bci=4, line=95 (Interpreted
frame)
>  - org.apache.commons.dbcp.BasicDataSource.getConnection() @bci=4, line=540 (Interpreted
frame)
>  - org.quartz.utils.PoolingConnectionProvider.getConnection() @bci=4, line=197 (Interpreted
frame)
>  - org.quartz.utils.DBConnectionManager.getConnection(java.lang.String) @bci=49, line=112
(Interpreted frame)
>  - com.abcd.jobs.utils.ABCDJobSchedulerUtil.getDBConnection() @bci=6, line=291 (Interpreted
frame)
>  - com.abcd.jobs.utils.ABCDJobSchedulerUtil.getJobs(javax.servlet.http.HttpServletRequest)
@bci=35, line=306 (Interpreted frame)
>  - org.apache.jsp.jobs_jsp._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
@bci=121, line=110 (Interpreted frame)
>  - org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) @bci=3, line=70 (Interpreted frame)
>  - javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
@bci=30, line=803 (Interpreted frame)
>  - org.apache.jasper.servlet.JspServletWrapper.service(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, boolean) @bci=395, line=393 (Interpreted frame)
>  - org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) @bci=134,
line=320 (Interpreted frame)
>  - org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) @bci=436, line=266 (Interpreted frame)
>  - javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
@bci=30, line=803 (Interpreted frame)
>  - org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) @bci=374, line=290 (Interpreted frame)
>  - org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) @bci=101, line=206 (Interpreted frame)
>  - com.abcd.jobs.filters.SessionCheckFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse,
javax.servlet.FilterChain) @bci=179, line=87 (Interpreted frame)
>  - org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) @bci=117, line=235 (Interpreted frame)
>  - org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) @bci=101, line=206 (Interpreted frame)
>  - org.apache.catalina.core.StandardWrapperValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) @bci=804, line=233 (Interpreted frame)
>  - org.apache.catalina.core.StandardContextValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) @bci=285, line=175 (Interpreted frame)
>  - org.apache.catalina.core.StandardHostValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) @bci=64, line=128 (Interpreted frame)
>  - org.apache.catalina.valves.ErrorReportValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) @bci=6, line=102 (Interpreted frame)
>  - org.apache.catalina.core.StandardEngineValve.invoke(org.apache.catalina.connector.Request,
org.apache.catalina.connector.Response) @bci=42, line=109 (Interpreted frame)
>  - org.apache.catalina.connector.CoyoteAdapter.service(org.apache.coyote.Request, org.apache.coyote.Response)
@bci=157, line=263 (Interpreted frame)
>  - org.apache.coyote.http11.Http11Processor.process(java.net.Socket) @bci=432, line=844
(Interpreted frame)
>  - org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(java.net.Socket)
@bci=82, line=584 (Interpreted frame)
>  - org.apache.tomcat.util.net.JIoEndpoint$Worker.run() @bci=41, line=447 (Interpreted
frame)
>  - java.lang.Thread.run() @bci=11, line=619 (Interpreted frame)
>
> Regards,
> Arun
>
>
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message