[jboss-jira] [JBoss JIRA] (JBJCA-1310) NPE when validating database connection (and the validation failed) if connection pool statistics is enabled

Jesper Pedersen (JIRA) issues at jboss.org
Thu Feb 11 07:39:00 EST 2016


     [ https://issues.jboss.org/browse/JBJCA-1310?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesper Pedersen moved WFLY-6172 to JBJCA-1310:
----------------------------------------------

              Project: IronJacamar  (was: WildFly)
                  Key: JBJCA-1310  (was: WFLY-6172)
             Workflow: classic default workflow  (was: GIT Pull Request workflow )
          Component/s: Core
                           (was: JCA)
    Affects Version/s: 1.2.6.Final
                       WildFly/IronJacamar 1.3.2.Final
                           (was: 10.0.0.Final)


> NPE when validating database connection (and the validation failed) if connection pool statistics is enabled
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: JBJCA-1310
>                 URL: https://issues.jboss.org/browse/JBJCA-1310
>             Project: IronJacamar
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.6.Final, WildFly/IronJacamar 1.3.2.Final
>            Reporter: Hugh Nguyen
>            Assignee: Jesper Pedersen
>
> - An xa-datasource connection pool is configured with: statistic-enabled=true, validate-on-match=true
> - When validation failed, after the failure, the following is logged:
> {code}
> 2016-02-10 12:23:12,580 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (Sched1_Worker-13) IJ000621: Destroying connection that could not be validated: null
> {code}
> - This appears to come from SemaphoreConcurrentLinkedDequeManagedConnectionPool.java, line 436:
> {code}
> log.destroyingConnectionNotValidated(clw.getConnectionListener());
> {code}
> - So apparently clw.getConnectionListener() is null at this point, causing line 441/442 to throw NPE, if statistics is enabled:
> {code}
> pool.getInternalStatistics().deltaTotalPoolTime(lastUsed - clw.getConnectionListener().getLastReturnedTime());
> {code}
> - NPE is caught by the catch clause, and line 456 write the following to the log:
> {code}
> 2016-02-10 12:23:12,580 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (Sched1_Worker-13) IJ000613: Throwable while trying to match managed connection, destroying connection: null: java.lang.NullPointerException
> 	at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.getConnection(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:441)
> 	at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getTransactionNewConnection(AbstractPool.java:708)
> 	at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:607)
> 	at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:590)
> 	at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:429)
> 	at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:747)
> {code}
> - However, this catch clause try to do the same thing that cause the NPE in line 461/462
> {code}
> pool.getInternalStatistics().deltaTotalPoolTime(lastUsed - clw.getConnectionListener().getLastReturnedTime());
> {code}
> - And finally this NPE is throw all the way out to the user of the connection



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list