Uploaded image for project: 'IronJacamar'
  1. IronJacamar
  2. JBJCA-1373

MySQLValidConnectionChecker swallow a root cause of the exception

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.4.9
    • None
    • JDBC
    • None

    Description

      When java.sql.SQLException is thrown, the root cause should be logged at the same time by MySQLValidConnectionChecker validation.
      ~~~
      WARN [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (default task-1) IJ030027: Destroying connection that is not valid, due to the following exception: com.mysql.jdbc.JDBC4Connection@5d0ae267: java.sql.SQLException: Ping failed: java.lang.reflect.InvocationTargetException
      at org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker.isValidConnection(MySQLValidConnectionChecker.java:93)
      at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnectionFactory.isValidConnection(BaseWrapperManagedConnectionFactory.java:1272)
      at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnectionFactory.getInvalidConnections(BaseWrapperManagedConnectionFactory.java:1085)
      ~~~
      However, the current code is :
      return new SQLException("Ping failed: " + e.toString());

      so this should be modified by:
      return new SQLException("Ping failed: " + e.toString(), e);

      and logged message with root cause.

      Attachments

        Issue Links

          Activity

            People

              pjurak Petr Jurak (Inactive)
              rhn-engineering-lgao Lin Gao
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: