mysql as datasource and closed idle connections
Harry Ng
harryworld at gmail.com
Wed Oct 3 05:00:38 EDT 2007
Hi Halm,
Actually the deployment in our environment is exactly the same as yours,
especially our production environment can stay awake for several weeks, with
more than 8 hours idle at the night time.
I am sure that we did not have anything special set on MySQL side, since I
do face problems of 8 hours in the development of Java Persistence
applications.
I will check why this works, and let you know if I know the answer.
Here provides the environment that we are using.
Environment:
Fedora Core 2
MySQL 5.0.27-max-log
Apache Tomcat 5.5.20 (commons-dbcp-1.2.1)
MySQL Connector 3.1.1
CAS Server 3.0.6
Regards,
Harry
Message: 5
> Date: Mon, 01 Oct 2007 11:21:41 +0200
> From: Halm Reusser <halm.reusser at switch.ch>
> Subject: Re: mysql as datasource and closed idle connections
> To: Yale CAS mailing list <cas at tp.its.yale.edu>
> Message-ID: <4700BC25.9090607 at switch.ch>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Dave,
>
> David Spencer wrote:
> > This problem can be solved at the Connection Pool rather than in the
> JDBC
> > Driver.
> you're absolutely right. I've configured my deployerConfigContext.xmllike:
>
> <bean id="dataSource" class="
> org.apache.commons.dbcp.BasicDataSource">
> <property name="driverClassName">
> <value>com.mysql.jdbc.Driver</value>
> </property>
> <property name="url">
> <value>jdbc:mysql://127.0.0.1/database_vho</value>
> </property>
>
> <property name="validationQuery">
> <value>SELECT 1</value>
> </property>
>
> <property name="testOnBorrow">
> <value>true</value>
> </property>
> </bean>
>
> The case, after restart of mysqld, is succesfully resolved, tomcat doesn't
> throw any exception. And when i trace the log:
>
> $ tail -f /var/log/mysql/mysql.log
> 6 Query SELECT 1
> 6 Query Select count('x') from view_cas Where login = 'abc'
> And password = 'xyz'
>
> it's shown that first the validationQuery is executed and after that, the
> authenticationQuery follows.
>
> So, tomorrow morning (overnight the CAS will be idle) i'll test my second
> case, which throws the exception.
>
> But, i believe your solution is working... :)
>
>
> So, thank you very much for your quick and perfect help.
>
> Halm Reusser
>
>
> ------------------------------
>
>
--
My Weblog - http://blog.planner4u.org/
LinkedIn - http://www.linkedin.com/in/harryng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tp.its.yale.edu/pipermail/cas/attachments/20071003/84607801/attachment.html
More information about the cas
mailing list