Solution for cocould not execute query MySQL database not accessed for more than 8 hours

Source: Internet
Author: User
Hibernate uses the connection pool of c3p0 to configure c3p0. 1. Import the c3p0. jar package. You can also download it from the Internet. 2. Add <property name = "c3p0. acquire_increment"> 1 </property> to the hibernate. cfg. xml configuration file. <Property name = "c3p0. idle_test_period"> 100 </property> <Property name = "c3p0. max_size"> 5 </property> <Property name = "c3p0. max_statements"> 0 </property> <Property name = "c3p0. min_size"> 2 </property> <Property name = "c3p0. Timeout"> 90 </property> <Property name = "c3p0. preferredtestquery"> select 1 from user where id = 1 </property> <Property name = "c3p0. idleconnectiontestperiod"> 18000 </property> <Property name = "c3p0. maxidletime"> 25000 </property> <Property name = "c3p0. testconnectiononcheckout"> true </property> 3. Restart tomcat to solve the problem. After you restart tomcat, you will be prompted to warn c3p0connectionprovider: 210-both hibernate-style property 'hibernate. c3p0. max_size 'and c3p0-style property' c3p0. max_size 'have been set in hibernate. properties. hibernate-style property 'hibernate. c3p0. max_size 'will be used and c3p0-style properties' c3p0. max_size 'will be ignored! Solution: Replace "c3p0. max_size" with "hibernate. c3p0. max_size". I found a lot on the Internet. I don't know if this solution works. No error is reported.
Related Article

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.