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

Paco Garcia commented on SOLR-5734:
-----------------------------------

Hi, with this change our dataimport process is around 15% longer than with 
4.7.0 Release. 
>From the logs it seems that the connection is closed and reopen in every sql.
 
After the change to nanoTime the method getConnection in JdbcDataSource.java is 
comparing nanos with millis. 

The constant CONN_TIME_OUT must be changed to nanos too. 

  private Connection getConnection() throws Exception {
    long currTime = System.nanoTime();
    if (currTime - connLastUsed > CONN_TIME_OUT) {
      synchronized (this) {
        Connection tmpConn = factory.call();
        closeConnection();
        connLastUsed = System.nanoTime();
        return conn = tmpConn;
      }

    } else {
      connLastUsed = currTime;
      return conn;
    }
  }

private static final long CONN_TIME_OUT = 10 * 1000; // 10 seconds


Regards

> We should use System.nanoTime rather than System.currentTimeMillis when 
> calculating elapsed time. 
> --------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-5734
>                 URL: https://issues.apache.org/jira/browse/SOLR-5734
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Mark Miller
>            Assignee: Mark Miller
>             Fix For: 4.8, 5.0, 4.7.1
>
>         Attachments: SOLR-5734.patch
>
>
> As brought up by [~andyetitmoves] in SOLR-5721.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to