#====================Basic Pool Configuration============================#初始化时的池大小,此值应该在minPollSize和maxPoolSize之间,如果设置的不合理,则会使用minPoolSize替代initialPoolSize=10#池最小值minPoolSize=10#池最大值maxPoolSize=150#当前连接用尽时,一次再创建多少个连接acquireIncrement=5#在丢弃前,一个连接可以空闲多少秒maxIdleTime=300#====================Managing Pool Size and Connection Age============================#一个连接可存活多少秒(从创建开始的计算)maxConnectionAge=800#超过minPoolSize数量的空闲连接,允许在线程池里面继续存在多少秒,此值要生效,必须小于maxIdleTimemaxIdleTimeExcessConnections=200#=================Configuring Connection Testing=======================#c3p0's default behavior is to test Connections by calling the getTables(),#DatabaseMetaData.getTables() is often much slower than a simple database query#f provided, c3p0 will create an empty table of the specified name, and use queries against that table to test the Connection# If automaticTestTable is provided, c3p0 will generate its own test query, therefore any preferredTestQuery set will be ignoredautomaticTestTable#Default: com.mchange.v2.c3p0.impl.DefaultConnectionTesterconnectionTesterClassName#每隔多少秒就测试一下所有的空闲连接idleConnectionTestPeriod=30#所有连接测试执行的查询语句preferredTestQuery=select 1#true/false 当连接还回连接池时,是否执行测试来校验连接是否有效testConnectionOnCheckin=false#true/false 当连接从连接池拿出时,是否执行测试来校验连接是否有效#Performing the (expensive) default Connection test on every client checkout will harm client performance.#Testing Connections in checkout is the simplest and most reliable form of Connection testing, but for better performance,#consider verifying connections periodically using idleConnectionTestPeriodtestConnectionOnCheckout=false#==========================Configuring Statement Pooling=============#maxStatements defines the total number PreparedStatements a DataSource will cachemaxStatements=180#每个connon可缓存的最大个数的statementmaxStatementsPerConnection=10#没太明白什么意思statementCacheNumDeferredCloseThreads#=================Configuring Recovery From Database Outages================#重试多少次连接的获取,default=30,如果为0,则表示无限次acquireRetryAttempts=20#重试获取conn的间隔毫秒数,default=1000acquireRetryDelay=1000#true/false,如果是true,则一个尝试周期获取conn失败,则DataSource关闭breakAfterAcquireFailure=false#=============Managing Connection Lifecycles with Connection Customizer=====#实现ConnectionCustomizer接口,可以对conn进行监控connectionCustomizerClassName#====================Configuring Unresolved Transaction Handling=======autoCommitOnClose=true#自己控制事务forceIgnoreUnresolvedTransactions=false#====================Configuring to Debug and Workaround Broken Client Applications===========#false/truedebugUnreturnedConnectionStackTraces#多少秒连接不返回,连接池就认为超时(可能会误杀正在使用的conn,不好的设计,但又是一个必要的设计)unreturnedConnectionTimeout#==================Configuring To Avoid Memory Leaks On Hot Redeploy Of Clients=========contextClassLoaderSourceprivilegeSpawnedThreads#===================Other DataSource Configuration=====================#getConnection()时等待多少毫秒,和acquireRetryAttempts,acquireRetryDelay(建立连接)有区别checkoutTimeoutfactoryClassLocationforceSynchronousCheckinsmaxAdministrativeTaskTimenumHelperThreads