Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1111533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:33:44+00:00 2026-05-17T02:33:44+00:00

since last post, did all the changes suggested but this problem still haunts me.

  • 0

since last post, did all the changes suggested but this problem still haunts me. Here’s the error i get:

Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 44,499,102 milliseconds ago.

here’s my hibernate.cfg.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>

    <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>        
    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>        
    <property name="connection.autoReconnect"> true</property>
    <property name="connection.autoReconnectForPools">true</property>
    <property name="connection.is-connection-validation-required">true</property>

    <property name="hibernate.c3p0.acquire_increment">5</property> 
    <property name="hibernate.c3p0.max_size">150</property>
    <property name="hibernate.c3p0.max_statements">0</property>
    <property name="hibernate.c3p0.min_size">10</property>
    <property name="hibernate.c3p0.timeout">100</property> <!-- seconds --> 
    <property name="hibernate.c3p0.idle_test_period">30</property> <!-- seconds --> 

    <property name="hibernate.connection.url">jdbc:mysql://!secret!autoReconnect=true</property>
    <property name="hibernate.connection.username">!secret!</property>
    <property name="hibernate.connection.password">!secret!</property>


    <!-- <property name="hibernate.connection.pool_size">10</property> -->

    <property name="show_sql">true</property>
    <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
    <property name="hibernate.hbm2ddl.auto">update</property>
    <property name="current_session_context_class">thread</property>

    <!-- Mapping files -->
    <mapping resource="mappings.hbm.xml"/>
</session-factory>
</hibernate-configuration>

and c3p0.properties

c3p0.preferredTestQuery=select 1 from dual
c3p0.maxConnectionAge=3600
c3p0.testConnectionOnCheckin=true
c3p0.testConnectionOnCheckout=true
c3p0.acquireRetryDelay=1000
c3p0.acquireRetryAttempts=30
c3p0.breakAfterAcquireFailure=false
c3p0.idleConnectionTestPeriod=100
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:33:45+00:00Added an answer on May 17, 2026 at 2:33 am

    As for me, you’re incorrectly configured c3p0.

    Properties like c3p0.preferredTestQuery must be located at c3p0.properties file from your classpath (e.g. WEB-INF/classes).

    Below is my example of c3p0.properties file that work nice for Oracle:

    c3p0.preferredTestQuery=SELECT 1 from dual
    c3p0.maxConnectionAge=3600
    c3p0.testConnectionOnCheckout=true
    c3p0.acquireRetryDelay=1000
    c3p0.acquireRetryAttempts=30
    c3p0.breakAfterAcquireFailure=false
    

    See also official doc for c3p0 here.

    And please pay your attention to version of c3p0 that you’re using. They had an issue connection restoring in early releases of c3p0 0.9.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Great guys have helped me a lot in this other post: Get last word
It's been a while since I last did Ruby programming -- looking at somebody
This is weird. Only on mobile safari, and since last night this script.... function
This code fails to actually save any changes: // // POST: /SomeType/Edit/5 [AcceptVerbs(HttpVerbs.Post)] public
This post is about C# and .Net, but some info is valuable for other
I ask this question in the hope of collecting all the incompatible changes/bugfixes in
I have researched this to no avail and thought I'd inquire here since the
I have included an example I am trying to test here but since I
I have a contact form on site which used to work, but since last
Since my last post I'm moving ahead. My Navigation Based Application has to contain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.