Author: shalin
Date: Tue Sep 22 12:23:44 2009
New Revision: 817634
URL: http://svn.apache.org/viewvc?rev=817634&view=rev
Log:
SOLR-1450 -- Jdbc connection properties such as batchSize are not applied if
the driver jar is placed in solr_home/lib
Modified:
lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt
lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java
Modified: lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt
URL:
http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt?rev=817634&r1=817633&r2=817634&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt (original)
+++ lucene/solr/trunk/contrib/dataimporthandler/CHANGES.txt Tue Sep 22 12:23:44
2009
@@ -258,6 +258,10 @@
(Jay Hill, Noble Paul via ehatcher)
29.SOLR-1323: Reset XPathEntityProcessor's $hasMore/$nextUrl when fetching
next URL (noble, ehatcher)
+
+30.SOLR-1450: Jdbc connection properties such as batchSize are not applied if
the driver jar is placed
+ in solr_home/lib.
+ (Steve Sun via shalin)
Documentation
Modified:
lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java
URL:
http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java?rev=817634&r1=817633&r2=817634&view=diff
==============================================================================
---
lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java
(original)
+++
lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java
Tue Sep 22 12:23:44 2009
@@ -153,6 +153,15 @@
"the jndi name : '"+jndiName +"' is not a valid
javax.sql.DataSource");
}
}
+ } catch (SQLException e) {
+ // DriverManager does not allow you to use a driver which is not
loaded through
+ // the class loader of the class which is trying to make the
connection.
+ // This is a workaround for cases where the user puts the driver jar
in the
+ // solr.home/lib or solr.home/core/lib directories.
+ Driver d = (Driver) DocBuilder.loadClass(driver,
context.getSolrCore()).newInstance();
+ c = d.connect(url, initProps);
+ }
+ if (c != null) {
if (Boolean.parseBoolean(initProps.getProperty("readOnly"))) {
c.setReadOnly(true);
// Add other sane defaults
@@ -181,13 +190,6 @@
} else {
c.setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT);
}
- } catch (SQLException e) {
- // DriverManager does not allow you to use a driver which is not
loaded through
- // the class loader of the class which is trying to make the
connection.
- // This is a workaround for cases where the user puts the driver jar
in the
- // solr.home/lib or solr.home/core/lib directories.
- Driver d = (Driver) DocBuilder.loadClass(driver,
context.getSolrCore()).newInstance();
- c = d.connect(url, initProps);
}
LOG.info("Time taken for getConnection(): "
+ (System.currentTimeMillis() - start));