[ 
https://issues.apache.org/jira/browse/METRON-100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15302047#comment-15302047
 ] 

ASF GitHub Bot commented on METRON-100:
---------------------------------------

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.


> GeoIP errors out silently in vagrant
> ------------------------------------
>
>                 Key: METRON-100
>                 URL: https://issues.apache.org/jira/browse/METRON-100
>             Project: Metron
>          Issue Type: Bug
>            Reporter: Casey Stella
>
> GeoIP Enrichment errors out silently in vagrant.  It's unclear whether it's 
> just some data that is problematic or everything, but I see this in the logs:
> com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 
> 'ip' at row 1
>         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4224) 
> ~[stormjar.jar:?]
>         at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:2188) 
> ~[stormjar.jar:?]
>         at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:2044) ~[stormjar.jar:?]
>         at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3538) 
> ~[stormjar.jar:?]
>         at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:489) 
> ~[stormjar.jar:?]
>         at 
> com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3240) 
> ~[stormjar.jar:?]
>         at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2411) 
> ~[stormjar.jar:?]
>         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2834) 
> ~[stormjar.jar:?]
>         at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2834) 
> ~[stormjar.jar:?]
>         at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2783) 
> ~[stormjar.jar:?]
>         at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1569) 
> ~[stormjar.jar:?]
>         at 
> org.apache.metron.enrichment.adapters.geo.GeoAdapter.enrich(GeoAdapter.java:50)
>  [stormjar.jar:?]
>         at 
> org.apache.metron.enrichment.adapters.geo.GeoAdapter.enrich(GeoAdapter.java:28)
>  [stormjar.jar:?]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to