tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Eggers <>
Subject Re: How to solve "To prevent a memory leak"
Date Thu, 16 Sep 2010 17:09:46 GMT
See the following Wiki article on how to use Hibernate and Tomcat's pooling.

As another person said, make sure you have a recently updated MySQL driver. I 
anything >= 5.1.11 solves a threading issue that was reported on their (MySQL's) 
tracking database.

. . . just my two cents.


----- Original Message ----
From: Alex <>
Sent: Thu, September 16, 2010 7:04:38 AM
Subject: Re: How to solve "To prevent a memory leak"

Thank for your response!

The MySql driver is in $TOMCAT/webapps/xxx/lib.
I using Hibernate as OMR Mapper with Spring 3.0, here my 
hibernateApllicationContext.xml (partial)
<bean id="datasource" class="com.mchange.v2.c3p0.ComboPooledDataSource" 
<property name="driverClass" value="${db.driverclass}" />
<property name="jdbcUrl" value="${db.jdbcurl}" />
<property name="user" value="${db.user}" />
<property name="password" value="${db.password}" />
<property name="acquireIncrement" value="1" />
<property name="idleConnectionTestPeriod" value="300" />
<property name="initialPoolSize" value="0" />
<property name="minPoolSize" value="3" />
<property name="maxPoolSize" value="10" />
<property name="maxIdleTime" value="600" />
<property name="maxStatements" value="50" />
<property name="preferredTestQuery" value="Select 1"/>
<property name="maxConnectionAge" value="3600"/>
<property name="acquireRetryAttempts" value="60"/>
<property name="testConnectionOnCheckout" value="true"/>

How can I search the ServletContext for specific objects?


Am 2010-09-16 15:43, schrieb Ognjen Blagojevic:
> On 16.9.2010 15:32, Alex wrote:
>> I run an web application which uses spring, hibernate, apache-cxf and
>> the quartz scheduler which is referenced by spring.
>> The webapp work as it should, but on shutdown or restart the apache
>> tomcat server I always get following output.
>> The webapp is not stopped and I have to kill the process manually.
>> How can I solve this?
> Are you using connection pooling provided by tomcat? Did you put MySQL driver 
>to $TOMCAT/lib or $TOMCAT/webapps/xxx/lib? Or both? If you are using connection 
>pooling keep your driver just in $TOMCAT/lib folder.
> If threads schedulerFactoryBeanERV_Worker-x, are created by Quartz, find how 
>can you stop them, and to that with ContextListener you will register in 
> Also, read
> Regards,
> Ognjen
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message