Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--
- Default options loaded by BoneCP. Modify as per your needs. This file has
- been automatically generated.
- -->
- <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 -->
- 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"/>
- <property name="maxConnectionsPerPartition" value="20"/>
- <property name="acquireIncrement" value="2"/>
- <property name="partitionCount" value="1"/>
- <!-- Sets the JDBC connection URL. -->
- <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/bdd_sdzee"/>
- <property name="user" value="root"/>
- <!-- Sets password to use for connections. -->
- <property name="password" value=""/>
- <property name="idleConnectionTestPeriodInMinutes" value="240"/>
- <property name="idleConnectionTestPeriodInSeconds" value="14400"/>
- <property name="idleMaxAgeInMinutes" value="60"/>
- <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"/>
- 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"/>
- <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"/>
- <property name="statisticsEnabled" value="false"/>
- 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).
- -->
- If set to true, try to unregister the JDBC driver when pool is
- shutdown.
- -->
- <property name="deregisterDriverOnClose" value="false"/>
- </jdbc-connection-pool>
- <jdbc-resource enabled="true" jndi-name="jdbc/bonecp_resource" object-type="user" pool-name="bonecpPool"/>
- </resources>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement