C3P0 apparent deadlock,

Source: Internet
Author: User

C3P0 apparent deadlock,

1. After running c3p0 for a period of time, the following error is reported:

W 07-26_00:58:27 ThreadPoolAsynchronousRunner.java 608 com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@70929ab6 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! W 07-26_00:58:39 ThreadPoolAsynchronousRunner.java 608 com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@4496b93a -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!

2. solution:


1. Update c3p0 to 0.9.2.1. This version optimizes the connection acquisition rules.

2. First modify the c3p0 configuration parameters

<! -- JDBC standard parameter, used to control the number of PreparedStatements loaded in the data source. However, the pre-cached statements belong to a single connection rather than the entire connection pool. Therefore, you need to consider many factors when setting this parameter. If both maxStatements and maxStatementsPerConnection are 0, the cache is disabled. Default: 0 --> <property name = "maxStatements" value = "0"/> <! -- The time for the customer to wait for the connection to be obtained after calling getConnection () when the connection pool is used up, in milliseconds. --> <! -- SQLEXCEPTION. If it is set to 0, the system waits infinitely. Default: 0 --> <property name = "checkoutTimeout" value = "100"/>





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.