[ 
https://issues.apache.org/jira/browse/DBCP-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487486
 ] 

Phil Steitz commented on DBCP-213:
----------------------------------

Thanks for the info.  You should run pool 1.3 with DBCP 1.2.2, but that is not 
likely to change anything here, as it looks to me from the stack traces that 
what is going on is the pool is exhausted and unless you or Hibernate 
(unlikely) are changing the settings somewhere, the default behavior for 
commons pool is to block (indefinitely) when the pool is exhausted.  You can 
address this in a couple of ways.  First,  make sure you are closing 
connections so they get returned to the pool and that maxActive is set high 
enough to handle your concurrent load.  Second,  set the maxWait property of 
the BasicDataSource (should be able to do this via Hibernate config) to a 
positive number (must be >0), which is the number of milliseconds that  a 
thread waiting for an available object from the pool will wait before throwing 
an exception.  

> DBCP causes tomcat to hang under moderate load
> ----------------------------------------------
>
>                 Key: DBCP-213
>                 URL: https://issues.apache.org/jira/browse/DBCP-213
>             Project: Commons Dbcp
>          Issue Type: Bug
>            Reporter: Sanjay Dahiya
>            Priority: Critical
>
> It appears that the problem in this case is with DBCP, so I am logging this 
> here. If i reload my web page rapidly a few times ( 5-6 times to be exact) it 
> causes tomcat to hang. A thread dump of tomcat shows multiple threads blocked 
> at this line. 
> I am using following options for - org.apache.commons.dbcp.BasicDataSource
>     <property name="maxActive" value="25"/>
>     <property name="maxIdle" value="10"/>
>     <property name="maxOpenPreparedStatements" value="50"/>
>     <property name="poolPreparedStatements" value="true"/>
> Not sure if its a bug or a misconfiguration. 
> "http-8080-2" daemon prio=5 tid=0x00567a20 nid=0x1951600 in Object.wait() 
> [0xf1599000..0xf159bab0]
>         at java.lang.Object.wait(Native Method)
>         - waiting on <0x2709d0e8> (a 
> org.apache.commons.pool.impl.GenericObjectPool)
>         at java.lang.Object.wait(Object.java:474)
>         at 
> org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:748)
>         - locked <0x2709d0e8> (a 
> org.apache.commons.pool.impl.GenericObjectPool)
>         at 
> org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
>         at 
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>         at 
> org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
>         at 
> org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:421)
>         at 
> org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
>         at 
> org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
>         at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1538)
>         at org.hibernate.loader.Loader.doQuery(Loader.java:661)
>         at 
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
>         at org.hibernate.loader.Loader.doList(Loader.java:2211)
>         at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
>         at org.hibernate.loader.Loader.list(Loader.java:2090)
>         at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
>         at 
> org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
>         at 
> org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
>         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
>         at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
>         at 
> org.springframework.orm.hibernate3.HibernateTemplate$29.doInHibernate(HibernateTemplate.java:844)
>         at 
> org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
>         at 
> org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:835)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to