DavidVdd
DavidVdd

Reputation: 1018

Solr DIH invalid fetch size

When I try to access my access db with solr DIH it gives me an error:

    java.sql.SQLException: Invalid Fetch Size

My configuration and requesthandler and dataconfig. Im using a 2007 access db from a file. I already changed my java version to 32bit to communicate with the 32bit driver. So I don't think its related to that.

<dataConfig>
  <dataSource type="JdbcDataSource" 
              driver="sun.jdbc.odbc.JdbcOdbcDriver"
              url="jdbc:odbc:test"
              batchSize="-1"
                convertType="true"/>
  <document>
    <entity name="id" 
            query="select ID from myTest">
    </entity>
  </document>
</dataConfig>

  <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
    <lst name="defaults">
      <str name="config">data-config.xml</str>
    </lst>
  </requestHandler>

Upvotes: 1

Views: 2707

Answers (1)

Henrik Andersson
Henrik Andersson

Reputation: 47212

Try setting your batchSize="-1" to batchSize="1" or 0. Setting the batchSize to -1 is the default value and thusly the DIH sets it to the default of 500 and some drivers can't handle that.

You can read more here DIH FAQ

As to your getting some other error, can you please post what that error is?

Upvotes: 2

Related Questions