after setting removeAbandoned to true it logged the stack that is helped me to isolate the code.
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="${jdbc.driverClassName}"/> <property name="url" value="${jdbc.url}"/> <property name="username" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> <property name="maxActive" value="10"/> <property name="maxWait" value="30"/> <property name="removeAbandoned" value="true"/> <property name="removeAbandonedTimeout" value="10"/> <property name="logAbandoned" value="true"/> <property name="poolPreparedStatements" value="true"/> <property name="defaultAutoCommit" value="true"/> </bean> Here is what the app code is doing. public class MyDaoHibernate extends HibernateDaoSupport public List myMethod(String user) { Query query = getSession().createSQLQuery("select ........"); List list = query.setCacheable(false).list(); return list; } The DBCP pool complained that this code borrowed a connection and did not return. Should we close any here? Thanks, Shan ashan wrote: > > Matt, > I'm using > MySQL version 5.0.24-community-nt > Driver: mysql-connector-java-5.0.5.jar > > Thanks > Shan > > > > mraible wrote: >> >> What database/version and jdbc-driver/version are you using? >> >> Matt >> >> On Wed, Feb 18, 2009 at 9:14 PM, ashan <arthan...@gmail.com> wrote: >> >>> >>> Hi, >>> >>> >>> I'm using appfuse 2.x. >>> >>> I'm getting connection pool exhausted error after a few logins. I was >>> simply logging out and logging in with a single browser. >>> >>> My applicationContext-resources.xml has the following: >>> >>> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" >>> destroy-method="close"> >>> <property name="driverClassName" >>> value="${jdbc.driverClassName}"/> >>> <property name="url" value="${jdbc.url}"/> >>> <property name="username" value="${jdbc.username}"/> >>> <property name="password" value="${jdbc.password}"/> >>> <property name="maxActive" value="10"/> >>> <property name="maxWait" value="60"/> >>> <property name="poolPreparedStatements" value="true"/> >>> <property name="defaultAutoCommit" value="true"/> >>> </bean> >>> >>> My web.xml has the following: >>> >>> <session-config> >>> <session-timeout>30</session-timeout> >>> </session-config> >>> >>> >>> I have also tried c3p0 as as suggested in one of the thread. When I use >>> this, after after a few logins, the browser just hangs (apparently >>> server >>> is waiting for more connection). >>> >>> Is this because leaking hibernate sessions? What is the hibernate >>> session >>> closing policy? and where this is specified? >>> >>> Please help! Thanks in advance!! >>> >>> >>> Environment: >>> ------------- >>> >>> Windows, Tomcat 6, appfuse.version-2.0.2, spring.version-2.5.4 >>> >>> >>> BTW I was able to reproduce the same in jetty as well. >>> >>> >>> Shan >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/connection-pool-exhausted-error-tp22093714s2369p22093714.html >>> Sent from the AppFuse - User mailing list archive at Nabble.com. >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net >>> For additional commands, e-mail: users-h...@appfuse.dev.java.net >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/connection-pool-exhausted-error-tp22093714s2369p22094090.html Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net For additional commands, e-mail: users-h...@appfuse.dev.java.net