[
https://issues.jboss.org/browse/JBESB-3853?page=com.atlassian.jira.plugin...
]
Tadayoshi Sato commented on JBESB-3853:
---------------------------------------
In the source code of JBoss ESB 4.10, the following object {{"oConn"}} can be
null and subsequently a NPE can happen because after the first successful invocation of
{{getDbConn()}} the datasource gets out of service.
{code}
473 final JdbcCleanConn oConn = getDbConn();
{code}
After the initial run of {{getDbConn()}} the {{JdbcCleanConn}} object is cached to_the
{{dbConn}} field, so the following if block won't be executed subsequently.
{code}
544 protected JdbcCleanConn getDbConn() {
545 DataSource oDS = null;
546 if (null == _dbConn) {
...
566 _dbConn = new JdbcCleanConn(oDS, transacted);
567 }
{code}
And rushing directly into the following line with shortage of the datasource will raise a
{{SQLException}} and execute {{releaseDBConnection()}} in the catch block, where is
exactly the place of resetting the {{dbConn}} field to null.
{code}
569 if ((null != _dbConn) && (_dbConn.getStatements().size() == 0)) {
570 try {
571 prepareStatements();
572 } catch (SQLException e) {
573 releaseDBConnection();
574 _ logger.warn("Exception preparing statements", e);
575 }
576 }
{code}
That's why we will have a NPE at the following line 509 and eventually
{{SqlTableGatewayListener}} will stop.
{code}
471 protected List<Map<String, Object>> pollForCandidates() {
...
473 final JdbcCleanConn oConn = getDbConn();
...
509 oConn.rollback();
{code}
So, I'd say the {{SqlTableGatewayListener}} can terminate forever regardless of the
datasource being recovered later in such a scenario that the datasource becomes
unavailable temporarily and have failed to make prepared statements by chance.
NPE thrown in SqlTableGatewayListener.getDbConn() causes the listener
to stop polling
-------------------------------------------------------------------------------------
Key: JBESB-3853
URL:
https://issues.jboss.org/browse/JBESB-3853
Project: JBoss ESB
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Transports
Affects Versions: 4.10 CP1, 4.11
Reporter: Tadayoshi Sato
Listener is not fetching the data from the database after the Data source disconnect and
reconnect. To resolve the issue we have to redeploy the esb.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira