- 浏览: 101017 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
j2eemylove:
是“恋舞OL”,给班同学做个广告
解码为中文 -
j2eemylove:
你当时有没有想到可能是不同字符间的转换问题了?!
解码为中文 -
everne:
唉,问题还没解决www.einverne.tk
重新设置ubuntu的用户密码
c3p0配置参数:
Default: 3 Determines how many connections at a time c3p0 will try to acquire when the pool is exhausted. [See "Basic Pool Configuration"] Default: 30 Defines how many times c3p0 will try to acquire a new Connection from the database before giving up. If this value is less than or equal to zero, c3p0 will keep trying to fetch a Connection indefinitely. [See "Configuring Recovery From Database Outages"] Default: 1000 Milliseconds, time c3p0 will wait between acquire attempts. [See "Configuring Recovery From Database Outages"] Default: false The JDBC spec is unforgivably silent on what should happen to unresolved, pending transactions on Connection close. C3P0's default policy is to rollback any uncommitted, pending work. (I think this is absolutely, undeniably the right policy, but there is no consensus among JDBC driver vendors.) Setting autoCommitOnClose to true causes uncommitted pending work to be committed, rather than rolled back on Connection close. [Note: Since the spec is absurdly unclear on this question, application authors who wish to avoid bugs and inconsistent behavior should ensure that all transactions are explicitly either committed or rolled-back before close is called.] [See "Configuring Unresolved Transaction Handling"] Default: null If 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 ignored. You should not work with the named table after c3p0 creates it; it should be strictly for c3p0's use in testing your Connection. (If you define your own ConnectionTester, it must implement the QueryConnectionTester interface for this parameter to be useful.) [See"Configuring Connection Testing"] Default: false If true, a pooled DataSource will declare itself broken and be permanently closed if a Connection cannot be obtained from the database after making acquireRetryAttemptsto acquire one. If false, failure to obtain a Connection will cause all Threads waiting for the pool to acquire a Connection to throw an Exception, but the DataSource will remain valid, and will attempt to acquire again following a call to getConnection(). [See "Configuring Recovery From Database Outages"] Default: 0 The number of milliseconds a client calling getConnection() will wait for a Connection to be checked-in or acquired when the pool is exhausted. Zero means wait indefinitely. Setting any positive value will cause the getConnection() call to time-out and break with an SQLException after the specified number of milliseconds. Default: null The fully qualified class-name of an implememtation of the ConnectionCustomizer interface, which users can implement to set up Connections when they are acquired from the database, or on check-out, and potentially to clean things up on check-in and Connection destruction. If standard Connection properties (holdability, readOnly, or transactionIsolation) are set in the ConnectionCustomizer's onAcquire() method, these will override the Connection default values. Default: com.mchange.v2.c3p0.impl.DefaultConnectionTester The fully qualified class-name of an implememtation of the ConnectionTester interface, or QueryConnectionTester if you would like instances to have access to a user-configured preferredTestQuery. This can be used to customize how c3p0 DataSources test Connections, but with the introduction of automaticTestTable andpreferredTestQuery configuration parameters, "rolling your own" should be overkill for most users. [See "Configuring Connection Testing"] Default: false If true, and if unreturnedConnectionTimeout is set to a positive value, then the pool will capture the stack trace (via an Exception) of all Connection checkouts, and the stack traces will be printed when unreturned checked-out Connections timeout. This is intended to debug applications with Connection leaks, that is applications that occasionally fail to return Connections, leading to pool growth, and eventually exhaustion (when the pool hits maxPoolSize with all Connections checked-out and lost). This parameter should only be set while debugging, as capturing the stack trace will slow down every Connection check-out. Does Not Support Per-User Overrides. Default: null DataSources that will be bound by JNDI and use that API's Referenceable interface to store themselves may specify a URL from which the class capable of dereferencing a them may be loaded. If (as is usually the case) the c3p0 libraries will be locally available to the JNDI service, leave this set as null. Does Not Support Per-User Overrides. Default: false Strongly disrecommended. Setting this to true may lead to subtle and bizarre bugs. This is a terrible setting, leave it alone unless absolutely necessary. It is here to workaround broken databases / JDBC drivers that do not properly support transactions, but that allow Connections' autoCommit flags to go to false regardless. If you are using a database that supports transactions "partially" (this is oxymoronic, as the whole point of transactions is to perform operations reliably and completely, but nonetheless such databases are out there), if you feel comfortable ignoring the fact that Connections with autoCommit == false may be in the middle of transactions and may hold locks and other resources, you may turn off c3p0's wise default behavior, which is to protect itself, as well as the usability and consistency of the database, by either rolling back (default) or committing (see c3p0.autoCommitOnClose above) unresolved transactions. This should only be set to true when you are sure you are using a database that allows Connections' autoCommit flag to go to false, but offers no other meaningful support of transactions. Otherwise setting this to true is just a bad idea. [See"Configuring Unresolved Transaction Handling"] Default: 0 If this is a number greater than 0, c3p0 will test all idle, pooled but unchecked-out connections, every this number of seconds. [See "Configuring Connection Testing"] Default: 3 Number of Connections a pool will try to acquire upon startup. Should be between minPoolSize and maxPoolSize. [See "Basic Pool Configuration"] Default: 0 Seconds before c3p0's thread pool will try to interrupt an apparently hung task. Rarely useful. Many of c3p0's functions are not performed by client threads, but asynchronously by an internal thread pool. c3p0's asynchrony enhances client performance directly, and minimizes the length of time that critical locks are held by ensuring that slow jdbc operations are performed in non-lock-holding threads. If, however, some of these tasks "hang", that is they neither succeed nor fail with an Exception for a prolonged period of time, c3p0's thread pool can become exhausted and administrative tasks backed up. If the tasks are simply slow, the best way to resolve the problem is to increase the number of threads, via numHelperThreads. But if tasks sometimes hang indefinitely, you can use this parameter to force a call to the task thread's interrupt() method if a task exceeds a set time limit. [c3p0 will eventually recover from hung tasks anyway by signalling an "APPARENT DEADLOCK" (you'll see it as a warning in the logs), replacing the thread pool task threads, and interrupt()ing the original threads. But letting the pool go into APPARENT DEADLOCK and then recover means that for some periods, c3p0's performance will be impaired. So if you're seeing these messages, increasing numHelperThreads and setting maxAdministrativeTaskTime might help.maxAdministrativeTaskTime should be large enough that any resonable attempt to acquire a Connection from the database, to test a Connection, or two destroy a Connection, would be expected to succeed or fail within the time set. Zero (the default) means tasks are never interrupted, which is the best and safest policy under most circumstances. If tasks are just slow, allocate more threads. If tasks are hanging forever, try to figure out why, and maybe setting maxAdministrativeTaskTime can help in the meantime. Does Not Support Per-User Overrides. Default: 0 Seconds, effectively a time to live. A Connection older than maxConnectionAge will be destroyed and purged from the pool. This differs from maxIdleTime in that it refers to absolute age. Even a Connection which has not been much idle will be purged from the pool if it exceeds maxConnectionAge. Zero means no maximum absolute age is enforced. Default: 0 Seconds a Connection can remain pooled but unused before being discarded. Zero means idle connections never expire. [See "Basic Pool Configuration"] Default: 0 Number of seconds that Connections in excess of minPoolSize should be permitted to remain idle in the pool before being culled. Intended for applications that wish to aggressively minimize the number of open Connections, shrinking the pool back towards minPoolSize if, following a spike, the load level diminishes and Connections acquired are no longer needed. If maxIdleTime is set, maxIdleTimeExcessConnections should be smaller if the parameter is to have any effect. Zero means no enforcement, excess Connections are not idled out. Default: 15 Maximum number of Connections a pool will maintain at any given time. [See "Basic Pool Configuration"] Default: 0 The size of c3p0's global PreparedStatement cache. If both maxStatements and maxStatementsPerConnection are zero, statement caching will not be enabled. IfmaxStatements is zero but maxStatementsPerConnection is a non-zero value, statement caching will be enabled, but no global limit will be enforced, only the per-connection maximum. maxStatements controls the total number of Statements cached, for all Connections. If set, it should be a fairly large number, as each pooled Connection requires its own, distinct flock of cached statements. As a guide, consider how many distinct PreparedStatements are used frequently in your application, and multiply that number by maxPoolSize to arrive at an appropriate value. Though maxStatements is the JDBC standard parameter for controlling statement caching, users may find c3p0's alternative maxStatementsPerConnection more intuitive to use. [See "Configuring Statement Pooling"] Default: 0 The number of PreparedStatements c3p0 will cache for a single pooled Connection. If both maxStatements and maxStatementsPerConnection are zero, statement caching will not be enabled. If maxStatementsPerConnection is zero but maxStatements is a non-zero value, statement caching will be enabled, and a global limit enforced, but otherwise no limit will be set on the number of cached statements for a single Connection. If set, maxStatementsPerConnection should be set to about the number distinct PreparedStatements that are used frequently in your application, plus two or three extra so infrequently statements don't force the more common cached statements to be culled. Though maxStatements is the JDBC standard parameter for controlling statement caching, users may find maxStatementsPerConnection more intuitive to use. [See "Configuring Statement Pooling"] Default: 3 Minimum number of Connections a pool will maintain at any given time. [See "Basic Pool Configuration"] Default: 3 c3p0 is very asynchronous. Slow JDBC operations are generally performed by helper threads that don't hold contended locks. Spreading these operations over multiple threads can significantly improve performance by allowing multiple operations to be performed simultaneously. Does Not Support Per-User Overrides. Default: null Forces the username that should by PooledDataSources when a user calls the default getConnection() method. This is primarily useful when applications are pooling Connections from a non-c3p0 unpooled DataSource. Applications that use ComboPooledDataSource, or that wrap any c3p0-implemented unpooled DataSource can use the simple user property. Does Not Support Per-User Overrides. Default: null Forces the password that should by PooledDataSources when a user calls the default getConnection() method. This is primarily useful when applications are pooling Connections from a non-c3p0 unpooled DataSource. Applications that use ComboPooledDataSource, or that wrap any c3p0-implemented unpooled DataSource can use the simplepassword property. Does Not Support Per-User Overrides. Default: null For applications using ComboPooledDataSource or any c3p0-implemented unpooled DataSources — DriverManagerDataSource or the DataSource returned byDataSources.unpooledDataSource( ... ) — defines the password that will be used for the DataSource's default getConnection() method. (See also user.) Does Not Support Per-User Overrides. Default: null Defines the query that will be executed for all connection tests, if the default ConnectionTester (or some other implementation of QueryConnectionTester, or better yetFullQueryConnectionTester) is being used. Defining a preferredTestQuery that will execute quickly in your database may dramatically speed up Connection tests. (If nopreferredTestQuery is set, the default ConnectionTester executes a getTables() call on the Connection's DatabaseMetaData. Depending on your database, this may execute more slowly than a "normal" database query.) NOTE: The table against which your preferredTestQuery will be run must exist in the database schemaprior to your initialization of your DataSource. If your application defines its own schema, try automaticTestTable instead. [See "Configuring Connection Testing"] Default: 0 Maximum time in seconds before user configuration constraints are enforced. Determines how frequently maxConnectionAge, maxIdleTime,maxIdleTimeExcessConnections, unreturnedConnectionTimeout are enforced. c3p0 periodically checks the age of Connections to see whether they've timed out. This parameter determines the period. Zero means automatic: A suitable period will be determined by c3p0. [You can call getEffectivePropertyCycle...() methods on a c3p0 PooledDataSource to find the period automatically chosen.] Default: false If true, an operation will be performed asynchronously at every connection checkin to verify that the connection is valid. Use in combination with idleConnectionTestPeriodfor quite reliable, always asynchronous Connection testing. Also, setting an automaticTestTable or preferredTestQuery will usually speed up all connection tests. [See"Configuring Connection Testing"] Default: false Use only if necessary. Expensive. If true, an operation will be performed at every connection checkout to verify that the connection is valid. Better choice: verify connections periodically using idleConnectionTestPeriod. Also, setting an automaticTestTable or preferredTestQuery will usually speed up all connection tests. [See"Configuring Connection Testing"] Default: 0 Seconds. If set, if an application checks out but then fails to check-in [i.e. close()] a Connection within the specified period of time, the pool will unceremoniously destroy() the Connection. This permits applications with occasional Connection leaks to survive, rather than eventually exhausting the Connection pool. And that's a shame. Zero means no timeout, applications are expected to close() their own Connections. Obviously, if a non-zero value is set, it should be to a value longer than any Connection should reasonably be checked-out. Otherwise, the pool will occasionally kill Connections in active use, which is bad. This is basically a bad idea, but it's a commonly requested feature. Fix your $%!@% applications so they don't leak Connections! Use this temporarily in combination with debugUnreturnedConnectionStackTraces to figure out where Connections are being checked-out that don't make it back into the pool! Default: null For applications using ComboPooledDataSource or any c3p0-implemented unpooled DataSources — DriverManagerDataSource or the DataSource returned byDataSources.unpooledDataSource() — defines the username that will be used for the DataSource's default getConnection() method. (See also password.) Does Not Support Per-User Overrides. Default: false c3p0 originally used reflective dynamic proxies for implementations of Connections and other JDBC interfaces. As of c3p0-0.8.5, non-reflective, code-generated implementations are used instead. As this was a major change, and the old codebase had been extensively used and tested, this parameter was added to allow users to revert of they had problems. The new, non-reflexive implementation is faster, and has now been widely deployed and tested, so it is unlikely that this parameter will be useful. Both the old reflective and newer non-reflective codebases are being maintained, but support for the older codebase may (or may not) be dropped in the future.
发表评论
-
使用push_subq优化SQL
2013-08-19 15:40 2150需要优化的SQL SELECT * FROM (SE ... -
hints的push_pred应用
2013-04-15 14:34 983前俩年在项目中优化了一条SQL,当时从40多秒减少到了2秒, ... -
抽取sequence的创建语句
2012-12-06 19:44 1029select 'create sequen ... -
强制删除用户
2012-11-02 13:22 966强制删除关联的session DECLARE ... -
druid配置
2012-11-01 16:01 13215web.xml配置,监控jsp和do请求,exclusions ... -
导入导出
2012-07-17 10:53 0SELECT * FROM All_Directo ... -
Oracle诊断事件列表
2012-06-07 16:49 1278来自http://www.eygle.com/internal ... -
逻辑读低,性能低的一次优化
2011-11-04 15:18 1078背景:维护反映客户现场的一个页面打开的速度非常慢,把该功能执行 ... -
记一次页面无响应调式过程
2011-10-12 09:15 1748现象 在发文节点,点击确定,页面没有响应. 调 ... -
ORACLE备份&恢复案例
2011-08-27 11:26 536ORACLE备份&恢复案 ... -
创建视图需要注意的问题
2011-08-23 15:35 1593创建视图报错 SQL> create or re ... -
获取执行计划的4种方式
2011-08-20 10:26 1313获取执行计划的4种方式 1:从计划表中获取,计划表名默 ... -
DBMS_STATS包使用
2011-08-19 09:53 2406有时候,想查看一下表中数据的增删改次数,可以使用视图USER_ ... -
获取运行时执行计划和统计信息
2011-08-03 13:26 1513在sql语句中加入提示/*+ gat ... -
hints
2011-08-01 13:58 9081:索引 SELECT /*+ index(e(ENT ... -
SQL Plus使用入门
2011-07-31 12:40 1085转载自: http://blog.csdn.net/wj ... -
sqlplus
2011-07-27 10:06 11081:输出结果到文件 spool c:\zhj.txt; ... -
记一次数据库优化
2011-07-20 16:46 832背景:电子政务系统显示公文数据列表打开的时候速度非常慢 ... -
sql_trace
2011-07-19 15:51 12491:设置sql_trace SQL>alter ... -
重建用户下的所有索引
2011-06-10 16:59 1305重建用户下的所有索引 DECLARE STR V ...
相关推荐
此外,还有其他C3P0特有的配置参数,如: - `c3p0.acquireIncrement`:每次增加的连接数。 - `c3p0.initialPoolSize`:初始连接池大小。 - `c3p0.idleConnectionTestPeriod`:检查空闲连接的时间间隔。 - `c3p0....
3. **连接池配置**:c3p0提供了丰富的配置参数,允许开发者根据具体需求调整连接池的行为,例如最小、最大连接数、超时时间等。 4. **性能优化**:通过设置合适的参数,c3p0可以实现更高效的连接管理和使用,比如...
以下是一些常见的c3p0配置参数: - `initialPoolSize`:初始化连接池的大小。 - `minPoolSize`:最小连接池大小,即使空闲也不会被回收。 - `maxPoolSize`:最大连接池大小,超过这个值,将不再创建新的连接。 - `...
5. **配置灵活**:c3p0允许通过配置参数调整连接池的行为,如最大连接数、最小连接数、超时时间等。 ### 配置c3p0 配置c3p0通常涉及以下几个步骤: 1. **添加依赖**:在项目中引入c3p0的jar包,通常包括`c3p0.jar...
3. **性能优化**:c3p0 支持连接池的配置参数调整,如最小、最大连接数,超时时间等,可以根据应用负载进行优化。 4. **支持多种数据库**:c3p0 不仅支持 MySQL、Oracle 这样的主流数据库,还兼容许多其他数据库...
### c3p0配置参数解析 #### acquireIncrement 此参数用于设置每次c3p0连接池增加连接的数量,默认值为3。在高并发场景下,适当调整此参数可以提高系统响应速度,但过高可能导致资源浪费或数据库负载过大。 #### ...
c3p0 提供了丰富的配置参数,可以根据实际应用需求进行调整,以下是一些常用参数: - `minPoolSize`:最小连接池大小,决定了空闲时连接池的最小数量。 - `maxPoolSize`:最大连接池大小,限制了并发访问数据库的...
-- c3p0配置参数 --> ``` 上述配置中,除了数据库连接的基本信息(如驱动、URL、用户名和密码),还包含了一些c3p0特有的配置参数,如初始池大小、最小池大小、最大池大小和最大空闲时间等。 **3. c3p0...
-- C3P0 配置参数 --> ``` 这里我们配置了C3P0连接池的基本属性,如数据库驱动、URL、用户名和密码。此外,还设置了最小连接数(minPoolSize)、最大连接数(maxPoolSize)和连接的最大空闲时间(maxIdleTime...
本文将详细介绍 C3P0 配置文件中的各个参数,并对其进行解释。 minPoolSize minPoolSize 参数用于设置连接池中保留的最小连接数。在上面的配置文件中,minPoolSize 设置为 5,这意味着连接池中至少保留 5 个连接。...
4. **优化C3P0配置**:根据实际应用的负载情况,调整C3P0的配置参数,例如测试发现数据库访问高峰时经常出现连接不足的情况,可以适当增加`maxPoolSize`;如果服务器资源有限,可以降低`minPoolSize`以减少内存占用...
配置文件`c3p0-config.xml`是C3P0的配置文件,通过它可以设置C3P0连接池的各种参数,如初始连接数量、最大连接数量、超时时间、测试查询等。例如,你可以设置`minPoolSize`来定义连接池最小的连接数,`maxPoolSize`...
在实际应用中,通常会通过Spring框架的DataSource配置或者直接在C3P0的配置文件(如c3p0.properties或通过代码设置)中进行这些参数的设定。例如: ```xml <bean id="dataSource" class="com.mchange.v2.c3p0....
配置C3P0连接池时,开发者通常需要在配置文件(如Hibernate的`hibernate.cfg.xml`或Spring的`applicationContext.xml`)中指定以下参数: - `driver_class`: 数据库驱动类名,例如`com.mysql.jdbc.Driver`。 - `...
C3P0的配置主要通过`c3p0.properties`文件进行,其中包含了许多关键参数: - `minPoolSize`:最小连接池大小,初始化时创建的连接数量。 - `maxPoolSize`:最大连接池大小,池中允许的最大连接数。 - `...
下面我们将详细介绍 Spring 配置 C3P0 的各项参数及其意义。 1. **driverClass**:指定数据库驱动类,例如 `com.mysql.jdbc.Driver`,这是连接 MySQL 数据库的驱动。 2. **jdbcUrl**:数据库连接字符串,包含了...
3. **配置参数**: c3p0有许多可配置的参数,如初始连接数、最大连接数、连接测试频率等,这些参数可以灵活调整以适应不同的应用需求。 **二、c3p0的配置** 在Spring中配置c3p0,通常需要在`applicationContext.xml...
下面是一些常见的C3P0配置参数及其作用: - `initialPoolSize`:初始化时连接池中的连接数量。 - `maxPoolSize`:连接池最大允许的连接数。 - `minPoolSize`:连接池最小保留的连接数。 - `maxIdleTime`:连接的...
在配置C3P0连接池时,合理设置参数对于优化数据库访问性能至关重要。 ### 重要参数详解 1. **acquireIncrement**:当连接池中的可用连接数量低于最小阈值时,C3P0会一次性增加此参数指定数量的连接。默认值为3,这...