lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raja Nagendra Kumar (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Deleted] (SOLR-5954) Slower dataimport process caused by not reusing jdbc connections
Date Thu, 03 Apr 2014 13:48:16 GMT

     [ https://issues.apache.org/jira/browse/SOLR-5954?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Raja Nagendra Kumar updated SOLR-5954:
--------------------------------------

    Comment: was deleted

(was: Patch attached)

> Slower dataimport process caused by not reusing jdbc connections
> ----------------------------------------------------------------
>
>                 Key: SOLR-5954
>                 URL: https://issues.apache.org/jira/browse/SOLR-5954
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>    Affects Versions: 4.7.1
>            Reporter: Paco Garcia
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 4.8, 4.7.2
>
>         Attachments: SOLR-5954.patch
>
>
> Hi, 
> SOLR-5734 introduced a regression that causes that the connections used in the dataimport
process were closed and reopen in every sql.
> The change to nanoTime in the method getConnection of JdbcDataSource.java forgot to convert
the timeout used to reuse the connection.
> The constant CONN_TIME_OUT must be changed to nanos to be compared. (*1000*1000)
> 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



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

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


Mime
View raw message