I recall having a similiar issue when moving to MySQL from MSSQL.  I
solved it by adding c3po.properties file to the classpath with the
text below.  It kept the connection alive with the database.

# This property corresponds to the query run defined by the
"hibernate.c3p0.idle_test_period" value
c3p0.preferredTestQuery = SELECT 1;

On Fri, Feb 25, 2011 at 12:53 AM, Jerson John <jer...@cprvision.com> wrote:
> Hi,
>
>  Yup I faced this problem before and flush to Hibernate group.They have
> suggested me some solution based on my mapping xml fle....Why don't u send
> me that mapping xml and let me compare with mine.....Actually Even though it
> look like Server error,its more to do with hibernate ....Please feel free to
> currect me if my assumption is  wrong
>
> Many Thanks and Regards,
>
> Jerson
>
>
> -----Original Message-----
> From: abhishek jain [mailto:abhishek.netj...@gmail.com]
> Sent: Friday, February 25, 2011 2:31 PM
> To: Struts Users Mailing List
> Subject: Exception in hibernate3
>
> hi,
> I am not sure if i am ringing the correct list, but i am sure people here
> must have encountered this problem. I am new to hibernate and when i ran the
> code on server it was fine , strangely next day it keep on giving this error
> till i restart tomcat.
>
> The last packet successfully received from the server was 54,880,316
> milliseconds ago.  The last packet sent successfully to the server was
> 54,880,317 milliseconds ago. is longer than the server configured value of
> 'wait_timeout'. You should consider either expiring and/or testing
> connection validity before use in your application, increasing the server
> configured values for client timeouts, or using the Connector/J connection
> property 'autoReconnect=true' to avoid this problem.
>
> I have searched a lot on net and added the following properties on
> hibernate.cfg.xml, as people there were suggesting this,but of no use.
> <!-- Sessions and transactions -->
> <!-- Use the C3P0 connection pool provider -->
> <property name="hibernate.c3p0.min_size">5</property>
> <property name="hibernate.c3p0.max_size">20</property>
> <property name="hibernate.c3p0.timeout">300</property>
> <property name="hibernate.c3p0.max_statements">50</property>
> <property name="hibernate.c3p0.idle_test_period">3000</property>
> <property name="current_session_context_class">thread</property>
>
>
>
> Pl. help me.
> I have used hibernate3 with myeclipse as the development environment, and am
> using mysql 5.x and centos (Linux) with Tomcat 5.x
> --
> Thanks and kind Regards,
> Abhishek jain
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to