tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <d...@cornell.edu>
Subject Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException : Cannot get a connection, pool error Timeout waiting for idle object
Date Sun, 12 Aug 2007 17:43:30 GMT
Oddly enough these are probably best explained in the commons-pool 
project (http://jakarta.apache.org/commons/pool) which was  a spin-off 
of DBCP.

maxWait is the maximum amount of time to wait for an object if the pool 
is full and there are no more objects (connections) to borrow.  
Essentially you're making a thread wait for an object to return to the 
pool from another borrow.

timeBetweenEvictionRunsMillis is the number of milliseconds to wait 
between runs of a background thread that tests all the object in the 
pool, removing those that aren't valid anymore.  In a connection pool it 
runs the validationQuery, removing the connection if the query fails.

You can look at this page for an official explanation:
http://commons.apache.org/pool/api-1.3/org/apache/commons/pool/impl/GenericObjectPool.html

--David

daad@libero.it wrote:
> who can explain me the use of parameters: maxWait and timeBetweenEvictionRunsMillis,
maybe with an example please? I read the api of it but can't understand the use of them...
thanks
>
>   
>> On 8/12/07, fusion35 <fusion35@hotmail.com> wrote:
>>     
>>> context.xml :
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!-- The contents of this file will be loaded for each web application -->
>>> <Context path="/PAF" reloadable="true" crossContext="true">
>>>   <Resource auth="Container" defaultAutoCommit="false"
>>> driverClassName="com.mysql.jdbc.Driver" maxActive="0" maxWait="1000"
>>> name="jdbc/PAFDB" password="root" timeBetweenEvictionRunsMillis="60000"
>>> type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/pafdb"
>>> username="root"/>
>>> </Context>
>>>
>>>
>>> The log of error is as under :
>>>
>>> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection,
>>> pool error Timeout waiting for idle object
>>>         at
>>> org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:104)
>>>         at
>>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>         at java.lang.reflect.Method.invoke(Unknown Source)
>>>         at bsh.Reflect.invokeMethod(Unknown Source)
>>>         at bsh.Reflect.invokeObjectMethod(Unknown Source)
>>>         at bsh.Name.invokeMethod(Unknown Source)
>>>         at bsh.BSHMethodInvocation.eval(Unknown Source)
>>>         at bsh.BSHPrimaryExpression.eval(Unknown Source)
>>>         at bsh.BSHPrimaryExpression.eval(Unknown Source)
>>>         at bsh.BSHAssignment.eval(Unknown Source)
>>>         at bsh.BSHBlock.evalBlock(Unknown Source)
>>>         at bsh.BSHBlock.eval(Unknown Source)
>>>         at bsh.BSHBlock.eval(Unknown Source)
>>>         at bsh.BSHTryStatement.eval(Unknown Source)
>>>         at bsh.BSHBlock.evalBlock(Unknown Source)
>>>         at bsh.BSHBlock.eval(Unknown Source)
>>>         at bsh.BshMethod.invokeImpl(Unknown Source)
>>>         at bsh.BshMethod.invoke(Unknown Source)
>>>         at bsh.BshMethod.invoke(Unknown Source)
>>>         at bsh.Name.invokeLocalMethod(Unknown Source)
>>>         at bsh.Name.invokeMethod(Unknown Source)
>>>         at bsh.BSHMethodInvocation.eval(Unknown Source)
>>>         at bsh.BSHPrimaryExpression.eval(Unknown Source)
>>>         at bsh.BSHPrimaryExpression.eval(Unknown Source)
>>>         at bsh.Interpreter.eval(Unknown Source)
>>>         at bsh.Interpreter.eval(Unknown Source)
>>>         at org.zkoss.zk.scripting.bsh.BSHInterpreter.exec(BSHInterpreter.java:80)
>>>         at
>>> org.zkoss.zk.scripting.util.GenericInterpreter.interpret(GenericInterpreter.java:283)
>>>         at org.zkoss.zk.ui.impl.PageImpl.interpret(PageImpl.java:727)
>>>         at org.zkoss.zk.ui.impl.EventProcessor.process0(EventProcessor.java:170)
>>>         at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138)
>>>         at
>>> org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:452)
>>>         at
>>> org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:370)
>>> Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
>>>         at
>>> org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:825)
>>>         at
>>> org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
>>>         ... 35 more
>>> Data Source : org.apache.tomcat.dbcp.dbcp.BasicDataSource@28305d
>>> Conn before : null
>>> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection,
>>> pool error Timeout waiting for idle object
>>>         at
>>> org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:104)
>>>         at
>>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>         at java.lang.reflect.Method.invoke(Unknown Source)
>>>         at bsh.Reflect.invokeMethod(Unknown Source)
>>>         at bsh.Reflect.invokeObjectMethod(Unknown Source)
>>>         at bsh.Name.invokeMethod(Unknown Source)
>>>         at bsh.BSHMethodInvocation.eval(Unknown Source)
>>>         at bsh.BSHPrimaryExpression.eval(Unknown Source)
>>>         at bsh.BSHPrimaryExpression.eval(Unknown Source)
>>>         at bsh.BSHAssignment.eval(Unknown Source)
>>>         at bsh.BSHBlock.evalBlock(Unknown Source)
>>>         at bsh.BSHBlock.eval(Unknown Source)
>>>         at bsh.BSHBlock.eval(Unknown Source)
>>>         at bsh.BSHTryStatement.eval(Unknown Source)
>>>         at bsh.BSHBlock.evalBlock(Unknown Source)
>>>         at bsh.BSHBlock.eval(Unknown Source)
>>>         at bsh.BshMethod.invokeImpl(Unknown Source)
>>>         at bsh.BshMethod.invoke(Unknown Source)
>>>         at bsh.BshMethod.invoke(Unknown Source)
>>>         at bsh.Name.invokeLocalMethod(Unknown Source)
>>>         at bsh.Name.invokeMethod(Unknown Source)
>>>         at bsh.BSHMethodInvocation.eval(Unknown Source)
>>>         at bsh.BSHPrimaryExpression.eval(Unknown Source)
>>>         at bsh.BSHPrimaryExpression.eval(Unknown Source)
>>>         at bsh.Interpreter.eval(Unknown Source)
>>>         at bsh.Interpreter.eval(Unknown Source)
>>>         at org.zkoss.zk.scripting.bsh.BSHInterpreter.exec(BSHInterpreter.java:80)
>>>         at
>>> org.zkoss.zk.scripting.util.GenericInterpreter.interpret(GenericInterpreter.java:283)
>>>         at org.zkoss.zk.ui.impl.PageImpl.interpret(PageImpl.java:727)
>>>         at org.zkoss.zk.ui.impl.EventProcessor.process0(EventProcessor.java:170)
>>>         at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138)
>>>         at
>>> org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:452)
>>>         at
>>> org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:370)
>>> Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
>>>         at
>>> org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:825)
>>>         at
>>> org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
>>>         ... 35 more
>>>
>>> --
>>>       
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>     
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message