Github user nickwallen commented on a diff in the pull request:

    https://github.com/apache/incubator-metron/pull/134#discussion_r64741859
  
    --- Diff: 
metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/adapters/jdbc/JdbcAdapter.java
 ---
    @@ -38,6 +39,27 @@
       private JdbcConfig config;
       private String host;
     
    +  protected boolean isConnectionClosed() {
    +    boolean isClosed = statement == null || connection == null;
    +    if(!isClosed) {
    +      try {
    +        isClosed = statement.isClosed() || connection.isClosed();
    +      } catch (SQLException e) {
    +        _LOG.error("Unable to maintain open JDBC connection: " + 
e.getMessage(), e);
    +        isClosed = true;
    +      }
    +    }
    +    return isClosed;
    +  }
    +
    +  protected boolean resetConnectionIfNecessary() {
    +    if(isConnectionClosed())
    +    {
    --- End diff --
    
    Sorry, nit-picky, but we have a new line between the if and the '{' which 
you don't do elsewhere in this code.  Would be nice to stick to one convention.
    
    We need to enhance our code style checks.  Hard to catch and enforce 
manually.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to