Hibernate inserts data in batches. MySQL prompts 1040-Too connector connections.

Source: Internet
Author: User
Tags mysql manual

8:34:13 net. SF. ehcache. config. configurationfactory parseconfiguration
Warning: No configuration found. processing ing ehcache from ehcache-failsafe.xml found in the classpath: jar: file:/C:/workspace /. metadata /. plugins/org. eclipse. WST. server. core/tmp3/wtpwebapps/ogschedule/WEB-INF/lib/ehcache-1.6.2.jar! Ehcache-failsafe.xml
8:34:13 net. SF. ehcache. cachemanager detectandfixdiskstorepathconflict
Warning creating a new instance of cachemanager using the diskstorepath "C: \ WINDOWS \ temp \" which is already used by an existing cachemanager.
The source of the configuration was classpath.
The diskstore path for this cachemanager will be set to c: \ windows \ temp \ ehcache_auto_created_1312504453046.
To avoid this warning consider using the cachemanager factory methods to create a singleton cachemanager or specifying a separate ehcache configuration (ehcache. XML) for each cachemanager instance.
Org. hibernate. Exception. genericjdbcexception: cannot open connection
...

========================================================== ====================

Cause: the default connection count for MySQL is 100, which is too small! The number of connections opened for your own SSH project is larger than this.

Solution: (Windows environment)

1. Find the my. ini file under c: \ Program Files \ mysql \ MySQL Server 5.0, open it in notepad, find "max_connections = 100", and change it to max_connections = 10000.

2. Set the c3p0. min_size of the SSH Project (here the c3p0 connection pool is located) to a smaller value. You can leave it alone, but it cannot be larger than 10000.

3. management tool-service: restart MySQL Service

 

MySQL manual has the following instructions:
Mysqld actually allows
Max_connections + 1
Clients to connect. The extra connection is reserved for use by accounts that have
Super privilege. by granting the super privilege to administrators and not to normal users (who shocould not need it ), an administrator can connect to the server and use show processlist to diagnose problems even if the maximum number of unprivileged clients
Are connected.
Therefore, only the super permission of the root user must be granted, and the super permission cannot be granted to all database connection accounts. The error reported above cannot be logged on because the root user directly configured in our application

 

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.