commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Euclides M (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DBCP-468) Hardcoded value false for fastFailValidation on constructor
Date Wed, 03 Aug 2016 17:34:20 GMT
Euclides M created DBCP-468:
-------------------------------

             Summary: 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.1.1, 2.2
            Reporter: Euclides M


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.

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)

Mime
View raw message