Hi everybody,
I'm developing an application with Tomcat, Hibernate and Mysql. Everything works fine but i get the classical error about mysql timeout after reaching "wait_timeout" time. I read a lot about it but i can't get any good tips about how to configure my app correctly.
Here is how i set it up:
In my context:
Quote:
<Resource
name="jdbc/dbapp"
auth="Container"
type="javax.sql.DataSource"
username="root"
password="****"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/dbapp?autoReconnect=true"
validationQuery="select 1"
maxActive="8"
maxIdle="4"
maxWait="10000" />
In web.xml:
Quote:
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/dbapp</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
My hibernate conf:
Quote:
<session-factory>
<property name="connection.datasource">java:comp/env/jdbc/dbapp</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="current_session_context_class">thread</property>
<mapping resource="..."/>
</session-factory>
What should I add to make sure connexions are tested and no Exception is thrown?
Thanx in advance