Advertisement
Guest User

Untitled

a guest
Aug 31st, 2017
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 8.45 KB | None | 0 0
  1. <!--
  2. Default options loaded by BoneCP. Modify as per your needs. This file has
  3.     been automatically generated.
  4. -->
  5. <resources>
  6. <jdbc-connection-pool name="bonecpPool" datasource-classname="com.jolbox.bonecp.BoneCPDataSource" transaction-isolation-level="read-committed"
  7. is-isolation-level-guaranteed="true" steady-pool-size="1" max-pool-size="20" res-type="javax.sql.DataSource">
  8. <!-- jdbc-connection-pool -->
  9.  
  10.  Sets the name of the pool for JMX and thread names.
  11. -->
  12. <property name="poolName" value="BoneCPPool"/>
  13. <!--
  14. Sets the minimum number of connections that will be contained in every partition.  
  15. -->
  16. <property name="driverClass" value="com.mysql.jdbc.Driver"/>
  17. <property name="minConnectionsPerPartition" value="1"/>
  18.  
  19. <property name="maxConnectionsPerPartition" value="20"/>
  20.  
  21. <property name="acquireIncrement" value="2"/>
  22.  
  23. <property name="partitionCount" value="1"/>
  24. <!--  Sets the JDBC connection URL.  -->
  25. <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/bdd_sdzee"/>
  26.  
  27. <property name="user" value="root"/>
  28. <!--  Sets password to use for connections.  -->
  29. <property name="password" value=""/>
  30.  
  31. <property name="idleConnectionTestPeriodInMinutes" value="240"/>
  32.  
  33. <property name="idleConnectionTestPeriodInSeconds" value="14400"/>
  34.  
  35. <property name="idleMaxAgeInMinutes" value="60"/>
  36.  
  37. <property name="idleMaxAgeInSeconds" value="3600"/>
  38.  
  39.  Sets the connection test statement.  The query to send to the DB
  40.           to maintain keep-alives and test for dead connections. This is database specific and
  41.           should be set to a query that consumes the minimal amount of load
  42.           on the server. Examples: MySQL: "/* ping *\/ SELECT 1", PostgreSQL: "SELECT NOW()".
  43.           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"
  44.           If you do not set this, then BoneCP will issue a metadata request
  45.           instead that should work on all databases but is probably slower.  (Note:
  46.           In MySQL, prefixing the statement by /* ping *\/ makes the driver issue
  47.           1 fast packet instead. See http://blogs.sun.com/SDNChannel/entry/mysql_tips_for_java_developers ) Default: Use metadata request
  48. -->
  49. <property name="connectionTestStatement" value="/* ping *\/ SELECT 1"/>
  50.  
  51.  Sets statementsCacheSize setting.  The number of statements to cache.
  52. -->
  53. <property name="statementsCacheSize" value="0"/>
  54.  
  55.  Sets number of helper threads to create that will handle releasing a connection.
  56.            When this value is set to zero, the application thread is blocked
  57.           until the pool is able to perform all the necessary cleanup to recycle
  58.           the connection and make it available for another thread.  When a non-zero
  59.           value is set, the pool will create threads that will take care of
  60.           recycling a connection when it is closed (the application dumps the connection into
  61.           a temporary queue to be processed asychronously to the application via the release
  62.           helper threads).  Useful when your application is doing lots of work on
  63.           each connection (i.e. perform an SQL query, do lots of non-DB stuff and
  64.           perform another query), otherwise will probably slow things down.
  65. -->
  66. <property name="releaseHelperThreads" value="3"/>
  67.  
  68.  Instruct the pool to create a helper thread to watch over connection acquires
  69.           that are never released (or released twice). This is for debugging purposes only
  70.           and will create a new thread for each call to getConnection(). Enabling this
  71.           option will have a big negative impact on pool performance.
  72. -->
  73. <property name="closeConnectionWatch" value="false"/>
  74. <!--  If enabled, log SQL statements being executed.  -->
  75. <property name="logStatementsEnabled" value="false"/>
  76. <!--
  77. Sets the number of ms to wait before attempting to obtain a connection
  78.          again after a failure.
  79. -->
  80. <property name="acquireRetryDelayInMs" value="7000"/>
  81. <!--
  82. Set to true to force the connection pool to obtain the initial connections
  83.          lazily.
  84. -->
  85. <property name="lazyInit" value="false"/>
  86. <!--
  87. Set to true to enable recording of all transaction activity and replay the
  88.          transaction automatically in case of a connection failure.
  89. -->
  90. <property name="transactionRecoveryEnabled" value="false"/>
  91. <!--
  92. After attempting to acquire a connection and failing, try to connect these many
  93.          times before giving up. Default 5.
  94. -->
  95. <property name="acquireRetryAttempts" value="5"/>
  96. <!--
  97. Sets the connection hook class name. Consider using setConnectionHook() instead.
  98. -->
  99. <!--
  100. <property name="connectionHookClassName" value="(null or no default value)"/>
  101. -->
  102. <!--  Set to true to disable JMX.  -->
  103. <property name="disableJMX" value="false"/>
  104.  
  105.  If set, use datasourceBean.getConnection() to obtain a new connection instead of Driver.getConnection().
  106. -->
  107.  
  108.  <property name="datasourceBean" value="(null or no default value)"/>
  109. -->
  110.  
  111.  Queries taking longer than this limit to execute are logged.
  112. -->
  113. <property name="queryExecuteTimeLimitInMs" value="0"/>
  114.  
  115.  Sets the Pool Watch thread threshold.  The pool watch thread attempts to
  116.           maintain a number of connections always available (between minConnections and maxConnections). This value
  117.           sets the percentage value to maintain. For example, setting it to 20 means
  118.           that if the following condition holds: Free Connections / MaxConnections < poolAvailabilityThreshold  
  119.          new connections will be created. In other words, it tries to keep at
  120.          least 20% of the pool full of connections. Setting the value to zero
  121.          will make the pool create new connections when it needs them but it
  122.          also means your application may have to wait for new connections to be
  123.          obtained at times.  Default: 20.
  124. -->
  125. <property name="poolAvailabilityThreshold" value="20"/>
  126.  
  127.  If set to true, the pool will not monitor connections for proper closure.
  128.           Enable this option if you only ever obtain your connections via a mechanism
  129.           that is guaranteed to release the connection back to the pool (eg Spring's
  130.           jdbcTemplate, some kind of transaction manager, etc).
  131. -->
  132. <property name="disableConnectionTracking" value="false"/>
  133.  
  134.  Sets the maximum time (in milliseconds) to wait before a call to getConnection
  135.           is timed out.  Setting this to zero is similar to setting it
  136.           to Long.MAX_VALUE  Default: 0 ( = wait forever )
  137. -->
  138. <property name="connectionTimeoutInMs" value="0"/>
  139.  
  140. <property name="closeConnectionWatchTimeoutInMs" value="0"/>
  141. <!--
  142. Sets number of statement helper threads to create that will handle releasing a
  143.          statement.  When this value is set to zero, the application thread is
  144.          blocked until the pool and JDBC driver are able to close off the
  145.          statement.  When a non-zero value is set, the pool will create threads
  146.          that will take care of closing off the statement asychronously to the application
  147.          via the release helper threads).  Useful when your application is opening up
  148.          lots of statements otherwise will probably slow things down.
  149. -->
  150. <property name="statementReleaseHelperThreads" value="0"/>
  151. <!--
  152. Sets the maxConnectionAge in seconds. Any connections older than this setting will be
  153.          closed off whether it is idle or not. Connections currently in use will
  154.          not be affected until they are returned to the pool.
  155. -->
  156. <property name="maxConnectionAgeInSeconds" value="0"/>
  157.  
  158. <property name="statisticsEnabled" value="false"/>
  159.  
  160.  If set to true, no attempts at passing in a username/password will be
  161.           attempted when trying to obtain a raw (driver) connection. Useful for cases when
  162.           you already have another mechanism on authentication eg NTLM.
  163. -->
  164. <property name="externalAuth" value="false"/>
  165.  
  166.  Sets the classloader to use to load JDBC driver and hooks (set to
  167.           null to use default).
  168. -->
  169.  If set to true, try to unregister the JDBC driver when pool is
  170.           shutdown.
  171. -->
  172. <property name="deregisterDriverOnClose" value="false"/>
  173.  
  174. </jdbc-connection-pool>
  175. <jdbc-resource enabled="true" jndi-name="jdbc/bonecp_resource" object-type="user" pool-name="bonecpPool"/>
  176. </resources>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement