1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
|
<?xml version="1.0" encoding="UTF-8"?>
<!-- Default options loaded by BoneCP. Modify as per your needs. This file has
been automatically generated. -->
<!DOCTYPE resources PUBLIC "-//Sun Microsystems Inc.//DTD Application Server 9.0 Domain//EN" "*<install directory>/lib/dtds/sun-resources_1_3.dtd*">
<resources>
<jdbc-connection-pool name="bonecpPool" datasource-classname="com.jolbox.bonecp.BoneCPDataSource" transaction-isolation-level="read-committed" is-isolation-level-guaranteed="true" steady-pool-size="1" max-pool-size="20" res-type="javax.sql.DataSource">
<!--jdbc-connection-pool-->
<!--Specifies the Transaction Isolation Level on the pooled
database connections. Optional. Has no default. If left
unspecified the pool operates with default isolation level
provided by the JDBC Driver. A desired isolation level can be
set using one of the standard transaction isolation levels,
which see.-->
<!--transaction-isolation-level="read-committed"-->
<!--Applicable only when a particular isolation level is
specified for transaction-isolation-level. The default value
is true. This assures that every time a connection is
obtained from the pool, it is guaranteed to have the
isolation set to the desired value. This could have some
performance impact on some JDBC drivers. Can be set to false
by that administrator when they are certain that the
application does not change the isolation level before
returning the connection.-->
<!--is-isolation-level-guaranteed="true"-->
<!--minimum and initial number of connections maintained in the pool.-->
<!--steady-pool-size="1"-->
<!--maximum number of conections that can be created-->
<!--max-pool-size="20"-->
<!--To aid user in detecting potential connection leaks by the
application. When a connection is not returned back to the
pool by the application within the specified period, it is
assumed to be a potential leak and stack trace of the caller
will be logged. Default is 0, which implies there is no leak
detection, by default. A positive non-zero value turns on
leak detection. Note however that, this attribute only
detects if there is a connection leak. The connection can be
reclaimed only if connection-leak-reclaim is set to true.-->
<!--connection-leak-timeout-in-seconds="21600"-->
<!--If enabled, connection will be reusable (put back into pool)
after connection-leak-timeout-in-seconds occurs. Default
value is false. -->
<!--connection-leak-reclaim="true"-->
<!--jdbc-connection-pool-->
<!-- Sets the name of the pool for JMX and thread names. -->
<property name="poolName" value="BoneCPPool"/>
<!-- Sets the minimum number of connections that will be contained in every partition. -->
<property name="driverClass" value="com.mysql.jdbc.Driver"/>
<property name="minConnectionsPerPartition" value="1"/>
<!-- Sets the maximum number of connections that will be contained in every partition.
Setting this to 5 with 3 partitions means you will have 15 unique
connections to the database. Note that the connection pool will not create all
these connections in one go but rather start off with minConnectionsPerPartition and gradually
increase connections as required. -->
<property name="maxConnectionsPerPartition" value="20"/>
<!-- Sets the acquireIncrement property. When the available connections are about to run
out, BoneCP will dynamically create new ones in batches. This property controls how
many new connections to create in one go (up to a maximum of
maxConnectionsPerPartition). Note: This is a per partition setting. -->
<property name="acquireIncrement" value="2"/>
<!-- Sets number of partitions to use. In order to reduce lock contention
and thus improve performance, each incoming connection request picks off a connection from
a pool that has thread-affinity, i.e. pool[threadId % partition_count]. The higher this number,
the better your performance will be for the case when you have plenty
of short-lived threads. Beyond a certain threshold, maintenance of these pools will start
to have a negative effect on performance (and only for the case when
connections on a partition start running out). Default: 1, minimum: 1, recommended:
2-4 (but very app specific) -->
<property name="partitionCount" value="1"/>
<!-- Sets the JDBC connection URL. -->
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/test"/>
<!-- Sets username to use for connections. -->
<!-- <property name="username" value="(null or no default value)"/> -->
<!-- Sets username to use for connections. Just delegates to setUsername for clients hardcoded
with "setUser" instead. -->
<property name="user" value="root"/>
<!-- Sets password to use for connections. -->
<property name="password" value="root"/>
<!-- Sets the idleConnectionTestPeriod. This sets the time (in minutes), for a connection
to remain idle before sending a test query to the DB. This is
useful to prevent a DB from timing out connections on its end. Do
not use aggressive values here! Default: 240 min, set to 0
to disable -->
<property name="idleConnectionTestPeriodInMinutes" value="240"/>
<!-- Sets the idleConnectionTestPeriod. This sets the time (in seconds), for a connection
to remain idle before sending a test query to the DB. This is
useful to prevent a DB from timing out connections on its end. Do
not use aggressive values here! Default: 240 min, set to 0
to disable -->
<property name="idleConnectionTestPeriodInSeconds" value="14400"/>
<!-- Sets Idle max age (in min). The time (in minutes), for a
connection to remain unused before it is closed off. Do not use aggressive
values here! Default: 60 minutes, set to 0 to disable. -->
<property name="idleMaxAgeInMinutes" value="60"/>
<!-- Sets Idle max age (in seconds). The time (in seconds), for a
connection to remain unused before it is closed off. Do not use aggressive
values here! Default: 60 minutes, set to 0 to disable. -->
<property name="idleMaxAgeInSeconds" value="3600"/>
<!-- Sets the connection test statement. The query to send to the DB
to maintain keep-alives and test for dead connections. This is database specific and
should be set to a query that consumes the minimal amount of load
on the server. Examples: MySQL: "/* ping *\/ SELECT 1", PostgreSQL: "SELECT NOW()".
Oracle : "SELECT SYS_CONTEXT('USERENV','SID') session_id, SYS_CONTEXT('USERENV','CURRENT_USER') oracle_user, SYS_CONTEXT('USERENV','DB_NAME') db_name, SYS_CONTEXT('USERENV','OS_USER') app_os_user, SYS_CONTEXT('USERENV','HOST') app_host, SYS_CONTEXT('USERENV','IP_ADDRESS') app_os_ip_address FROM DUAL"
If you do not set this, then BoneCP will issue a metadata request
instead that should work on all databases but is probably slower. (Note:
In MySQL, prefixing the statement by /* ping *\/ makes the driver issue
1 fast packet instead. See http://blogs.sun.com/SDNChannel/entry/mysql_tips_for_java_developers ) Default: Use metadata request -->
<property name="connectionTestStatement" value="/* ping *\/ SELECT 1"/>
<!-- Sets statementsCacheSize setting. The number of statements to cache. -->
<property name="statementsCacheSize" value="0"/>
<!-- Sets number of helper threads to create that will handle releasing a connection.
When this value is set to zero, the application thread is blocked
until the pool is able to perform all the necessary cleanup to recycle
the connection and make it available for another thread. When a non-zero
value is set, the pool will create threads that will take care of
recycling a connection when it is closed (the application dumps the connection into
a temporary queue to be processed asychronously to the application via the release
helper threads). Useful when your application is doing lots of work on
each connection (i.e. perform an SQL query, do lots of non-DB stuff and
perform another query), otherwise will probably slow things down. -->
<property name="releaseHelperThreads" value="3"/>
<!-- Sets the connection hook. Fully qualified class name that implements the ConnectionHook
interface (or extends AbstractConnectionHook). BoneCP will callback the specified class according to the
connection state (onAcquire, onCheckIn, onCheckout, onDestroy). -->
<!-- <property name="connectionHook" value="(null or no default value)"/> -->
<!-- Specifies an initial SQL statement that is run only when a connection is
first created. -->
<!-- <property name="initSQL" value="(null or no default value)"/> -->
<!-- Instruct the pool to create a helper thread to watch over connection acquires
that are never released (or released twice). This is for debugging purposes only
and will create a new thread for each call to getConnection(). Enabling this
option will have a big negative impact on pool performance. -->
<property name="closeConnectionWatch" value="false"/>
<!-- If enabled, log SQL statements being executed. -->
<property name="logStatementsEnabled" value="false"/>
<!-- Sets the number of ms to wait before attempting to obtain a connection
again after a failure. -->
<property name="acquireRetryDelayInMs" value="7000"/>
<!-- Set to true to force the connection pool to obtain the initial connections
lazily. -->
<property name="lazyInit" value="false"/>
<!-- Set to true to enable recording of all transaction activity and replay the
transaction automatically in case of a connection failure. -->
<property name="transactionRecoveryEnabled" value="false"/>
<!-- After attempting to acquire a connection and failing, try to connect these many
times before giving up. Default 5. -->
<property name="acquireRetryAttempts" value="5"/>
<!-- Sets the connection hook class name. Consider using setConnectionHook() instead. -->
<!-- <property name="connectionHookClassName" value="(null or no default value)"/> -->
<!-- Set to true to disable JMX. -->
<property name="disableJMX" value="false"/>
<!-- If set, use datasourceBean.getConnection() to obtain a new connection instead of Driver.getConnection(). -->
<!-- <property name="datasourceBean" value="(null or no default value)"/> -->
<!-- Queries taking longer than this limit to execute are logged. -->
<property name="queryExecuteTimeLimitInMs" value="0"/>
<!-- Sets the Pool Watch thread threshold. The pool watch thread attempts to
maintain a number of connections always available (between minConnections and maxConnections). This value
sets the percentage value to maintain. For example, setting it to 20 means
that if the following condition holds: Free Connections / MaxConnections < poolAvailabilityThreshold
new connections will be created. In other words, it tries to keep at
least 20% of the pool full of connections. Setting the value to zero
will make the pool create new connections when it needs them but it
also means your application may have to wait for new connections to be
obtained at times. Default: 20. -->
<property name="poolAvailabilityThreshold" value="20"/>
<!-- If set to true, the pool will not monitor connections for proper closure.
Enable this option if you only ever obtain your connections via a mechanism
that is guaranteed to release the connection back to the pool (eg Spring's
jdbcTemplate, some kind of transaction manager, etc). -->
<property name="disableConnectionTracking" value="false"/>
<!-- Sets the maximum time (in milliseconds) to wait before a call to getConnection
is timed out. Setting this to zero is similar to setting it
to Long.MAX_VALUE Default: 0 ( = wait forever ) -->
<property name="connectionTimeoutInMs" value="0"/>
<!-- Sets the no of ms to wait when close connection watch threads are
enabled. 0 = wait forever. -->
<property name="closeConnectionWatchTimeoutInMs" value="0"/>
<!-- Sets number of statement helper threads to create that will handle releasing a
statement. When this value is set to zero, the application thread is
blocked until the pool and JDBC driver are able to close off the
statement. When a non-zero value is set, the pool will create threads
that will take care of closing off the statement asychronously to the application
via the release helper threads). Useful when your application is opening up
lots of statements otherwise will probably slow things down. -->
<property name="statementReleaseHelperThreads" value="0"/>
<!-- Sets the maxConnectionAge in seconds. Any connections older than this setting will be
closed off whether it is idle or not. Connections currently in use will
not be affected until they are returned to the pool. -->
<property name="maxConnectionAgeInSeconds" value="0"/>
<!-- Sets the configFile. If configured, this will cause the pool to initialise using
the config file in the same way as if calling new BoneCPConfig(filename). -->
<!-- <property name="configFile" value="(null or no default value)"/> -->
<!-- Sets the queue serviceOrder. Values currently understood are FIFO and LIFO. -->
<!-- <property name="serviceOrder" value="(null or no default value)"/> -->
<!-- If set to true, keep track of some more statistics for exposure via
JMX. Will slow down the pool operation. -->
<property name="statisticsEnabled" value="false"/>
<!-- Sets the defaultAutoCommit setting for newly created connections. If not set, use driver
default. -->
<!-- <property name="defaultAutoCommit" value="(null or no default value)"/> -->
<!-- Sets the defaultReadOnly setting for newly created connections. If not set, use driver
default. -->
<!-- <property name="defaultReadOnly" value="(null or no default value)"/> -->
<!-- Sets the defaultCatalog setting for newly created connections. If not set, use driver
default. -->
<!-- <property name="defaultCatalog" value="(null or no default value)"/> -->
<!-- Sets the defaultTransactionIsolation. Should be set to one of: NONE, READ_COMMITTED, READ_UNCOMMITTED, REPEATABLE_READ
or SERIALIZABLE. If not set, will use driver default. -->
<!-- <property name="defaultTransactionIsolation" value="(null or no default value)"/> -->
<!-- If set to true, no attempts at passing in a username/password will be
attempted when trying to obtain a raw (driver) connection. Useful for cases when
you already have another mechanism on authentication eg NTLM. -->
<property name="externalAuth" value="false"/>
<!-- Sets the classloader to use to load JDBC driver and hooks (set to
null to use default). -->
<!-- <property name="classLoader" value="(null or no default value)"/> -->
<!-- If set to true, try to unregister the JDBC driver when pool is
shutdown. -->
<property name="deregisterDriverOnClose" value="false"/>
<!-- Sets the nullOnConnectionTimeout. If true, return null on connection timeout rather than
throw an exception. This performs better but must be handled differently in your
application. This only makes sense when using the connectionTimeout config option. -->
<!-- <property name="nullOnConnectionTimeout" value="(null or no default value)"/> -->
</jdbc-connection-pool>
<jdbc-resource enabled="true" jndi-name="jdbc/bonecp_resource" object-type="user" pool-name="bonecpPool"/>
</resources> |
Partager