I am working on Spring+Hibernate+JSF but if i am ideal on a page for few minute i am getting exception when trying some Database query
The last packet successfully received from the server was 2,615,049 milliseconds ago. The last packet sent successfully to the server was 27 milliseconds ago.
Caused by: org.hibernate.TransactionException: JDBC begin transaction failed:
at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doBegin(JdbcTransaction.java:76)
at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.begin(AbstractTransactionImpl.java:160)
at org.hibernate.internal.SessionImpl.beginTransaction(SessionImpl.java:1309)
at org.springframework.orm.hibernate4.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:474)
... 46 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Is this issue due to any configuration in my project or its database vendor issue in web.xml i made this entry
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
Connection pool
<bean id="DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="com.mysql.jdbc.Driver" />
<property name="jdbcUrl" value="jdbc:mysql://IP:3306/ccc" />
<property name="user" value=" hariom" />
<property name="password" value="password" />
<property name="maxPoolSize" value="2" />
<property name="maxStatements" value="0" />
<property name="minPoolSize" value="1" />
</bean>
session-timeoutsetting is about http sessions and isn't related to database. To answer your question we should know more about your setup, especially about connection pool which you use. Is it Apache DBCP, c3p0, BoneCP or something else? How you configure datasource?