C3p0 Configuration Overview

Source: Internet
Author: User

<C3p0-config>
<Default-config>
<! -- The number of connections that c3p0 obtains at the same time when connections in the connection pool are exhausted. Default: 3 -->
<Property name = "acquireincrement"> 3 </property>
<! -- Defines the number of repeated attempts after a new connection fails to be obtained from the database. Default: 30 -->
<Property name = "acquireretryattempts"> 30 </property>
<! -- Interval between two connections, in milliseconds. Default: 1000 -->
<Property name = "acquireretrydelay"> 1000 </property>
<! -- When the connection is closed, all uncommitted operations are rolled back by default. Default: false -->
<Property name = "autocommitonclose"> false </property>
<! -- C3p0 creates an empty table named test and uses its own query statement for testing. If this parameter is defined
The preferredtestquery attribute is ignored. You cannot perform any operation on this test table. It will only be used for c3p0 testing.
. Default: NULL -->
<Property name = "automatictesttable"> test </property>
<! -- Failed to obtain the connection will cause all threads waiting for the connection pool to obtain the connection to throw an exception. However, the data source is still valid.
Retained, and continue to get the connection when getconnection () is called the next time. If it is set to true
After the connection fails, the data source is declared disconnected and permanently closed. Default: false -->
<Property name = "breakafteracquirefailure"> false </property>
<! -- When the connection pool is used up, the client calls getconnection () and waits for the time to obtain the new connection.
Sqlexception. If it is set to 0, it will wait indefinitely. Unit: milliseconds. Default: 0 -->
<Property name = "checkouttimeout"> 100 </property>
<! -- Test the connection by implementing the connectiontester or queryconnectiontester class. The full path must be specified for the class name.
Default: COM. mchange. v2.c3p0. impl. defaultconnectiontester -->
<Property name = "connectiontesterclassname"> </property>
<! -- Specify the path of c3p0 libraries. If (usually like this) can be obtained locally, you do not need to set it. The default value is null.
Default: NULL -->
<Property name = "factoryclasslocation"> null </property>
<! -- Stronugly disrecommended. setting this to true may lead to subtle and bizarre bugs.
(Original document) an attribute that the author strongly recommends not to use -->
<Property name = "forceignoreunresolvedtransactions"> false </property>
<! -- Check all idle connections in the connection pool every 60 seconds. Default: 0 -->
<Property name = "idleconnectiontestperiod"> 60 </property>
<! -- Three connections are obtained during initialization. The value must be between minpoolsize and maxpoolsize. Default: 3 -->
<Property name = "initialpoolsize"> 3 </property>
<! -- Maximum idle time. connections are dropped if they are not used within 60 seconds. If it is 0, it will never be discarded. Default: 0 -->
<Property name = "maxidletime"> 60 </property>
<! -- The maximum number of connections retained in the connection pool. Default: 15 -->
<Property name = "maxpoolsize"> 15 </property>
<! -- JDBC standard parameter, used to control the number of preparedstatements loaded in the data source. However, due to the pre-Cache statements
Belongs to a single connection pool 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"> 100 </property>
<! -- Maxstatementsperconnection defines the maximum number of statements cached for a single connection in the connection pool. Default: 0 -->
<Property name = "maxstatementsperconnection"> </property>
<! -- C3p0 is asynchronous, and slow JDBC operations are completed by helping the process. Scaling these operations can effectively improve performance
Multiple operations are executed simultaneously through multiple threads. Default: 3 -->
<Property name = "numhelperthreads"> 3 </property>
<! -- When the user calls getconnection (), the root user becomes the user who gets the connection. Used to connect a connection pool to non-c3p0
. Default: NULL -->
<Property name = "overridedefaultuser"> root </property>
<! -- This parameter corresponds to the overridedefaultuser parameter. Default: NULL -->
<Property name = "overridedefaultpassword"> password </property>
<! -- Password. Default: NULL -->
<Property name = "password"> </property>
<! -- Define the test statement executed for all connection tests. This significantly increases the testing speed when connection tests are used. Note:
The test table must exist at the initial data source. Default: NULL -->
<Property name = "preferredtestquery"> select ID from test where id = 1 </property>
<! -- The user can wait up to 300 seconds before modifying system configuration parameters. Default: 300 -->
<Property name = "propertycycle"> 300 </property>
<! -- Because of high performance consumption, use it only when needed. If set to true
Will verify its validity. We recommend that you use idleconnectiontestperiod or automatictesttable
To improve the connection test performance. Default: false -->
<Property name = "testconnectioncheckout"> false </property>
<! -- If it is set to true, the connection validity will be verified when the connection is obtained. Default: false -->
<Property name = "testconnectiononcheckin"> true </property>
<! -- User name. Default: NULL -->
<Property name = "user"> root </property>
<! -- Early versions of c3p0 used dynamic reflection proxy for JDBC interfaces. This parameter is widely used in earlier versions.
Allows the user to recover to the dynamic reflection proxy to solve unstable faults. The latest non-reflection proxy is faster and has started
This parameter may not be useful because it is widely used. Currently, the original dynamic reflection and the new non-reflection proxy are both subject
Yes. However, in future versions, dynamic reflection proxy may not be supported. Default: false -->
<Property name = "usestraditionalreflectiveproxies"> false </property>
<Property name = "automatictesttable"> con_test </property>
<Property name = "checkouttimeout"> 30000 </property>
<Property name = "idleconnectiontestperiod"> 30 </property>
<Property name = "initialpoolsize"> 10 </property>
<Property name = "maxidletime"> 30 </property>
<Property name = "maxpoolsize"> 25 </property>
<Property name = "minpoolsize"> 10 </property>
<Property name = "maxstatements"> 0 </property>
<User-overrides user = "swaldman">
</User-overrides>
</Default-config>
<Named-config name = "dumbtestconfig">
<Property name = "maxstatements"> 200 </property>
<User-overrides user = "poop">
<Property name = "maxstatements"> 300 </property>
</User-overrides>
</Named-config>
C3p0-config>

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.