[
https://issues.apache.org/jira/browse/DBCP-468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mark Thomas resolved DBCP-468.
------------------------------
Resolution: Fixed
Fix Version/s: 2.2
Thanks for the report.
> Hardcoded value false for fastFailValidation on constructor
> -----------------------------------------------------------
>
> Key: DBCP-468
> URL: https://issues.apache.org/jira/browse/DBCP-468
> Project: Commons Dbcp
> Issue Type: Bug
> Affects Versions: 2.2, 2.1.1
> Reporter: Euclides M
> Fix For: 2.2
>
>
> Debugging my code, i Found that fastFailValidation is always false because of
> this Constructor:
> {code:title=org.apache.commons.dbcp2.PoolableConnection|borderStyle=solid}
> /**
> *
> * @param conn my underlying connection
> * @param pool the pool to which I should return when closed
> * @param jmxName JMX name
> */
> public PoolableConnection(Connection conn,
> ObjectPool<PoolableConnection> pool, ObjectName jmxName) {
> this(conn, pool, jmxName, null, false);
> }
> {code}
> Notice that 4th and 5th params are for fastFailValidation. It will always be
> false. (and null for sql codes)
> My Pool definition (spring):
> {code:xml}
> <bean id="dataSource"
> class="org.apache.commons.dbcp2.managed.BasicManagedDataSource"
> destroy-method="close">
> <property name="transactionManager" ref="jbossTransactionManager"/>
> <property name="driverClassName" value="xxx" />
> <property name="url" value="xxx" />
> <property name="username" value="xxx" />
> <property name="password" value="xxx" />
> <property name="initialSize" value="0" />
> <property name="defaultAutoCommit" value="false" />
> <property name="maxTotal" value="1" />
> <property name="maxIdle" value="0" />
> <property name="maxWaitMillis" value="5000" />
> <property name="testOnBorrow" value="true" />
> <property name="testOnReturn" value="false" />
> <property name="fastFailValidation" value="true" />
> <property name="validationQuery" value="select 1 go" />
> </bean>
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)