Hibernate c3p0 Configuration

Source: Internet
Author: User

Hibernate was used in the project. Later, the connection was automatically disconnected when MySQL was idle for 8 hours. In this way, the s3p0 connection pool was used to try. Which of the following errors still persists:

Com. mchange. v2.resourcepool. basicresourcepool $ asynctestidleresourcetask run

Specified resource usage: basicresourcepool: An idle resource is broken and will be purged. java. SQL. sqlexception: communication link failure: java.net. socketexception, underlying cause: Software caused connection abort, record it and back it up on your own. At the same time, I hope to give a reference to my friends who have encountered the same problem.

<Property name = "show_ SQL"> false </property> <property name = "hibernate. connection. provider_class "> Org. hibernate. connection. c3p0connectionprovider </property> <property name = "hibernate. c3p0. min_size "> 8 </property> <property name =" hibernate. c3p0. max_size "> 200 </property> <property name =" hibernate. c3p0. timeout "> 600 </property> <property name =" hibernate. c3p0. max_statements "> 0 </property> <property name =" hibernate. c3p0. idle_test_period "> 60 </property> <property name =" hibernate. c3p0. acquire_increment "> 2 </property> <property name =" hibernate. c3p0. validate "> true </property>: although the problem has been solved, I still don't quite understand why this configuration is implemented in some places. If you have any comments on this configuration, let's discuss it together.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.