I was able to resolve this issue by using a different jdbc driver: 
http://www.xerial.org/trac/Xerial/wiki/SQLiteJDBC


-----Original Message-----
From: Zac Smith [mailto:z...@trinkit.com] 
Sent: Friday, April 01, 2011 5:56 PM
To: solr-user@lucene.apache.org
Subject: Using the Data Import Handler with SQLite

I hope this question is being directed to the right place ...

I am trying to use SQLite (v3) as a source for the Data Import Handler. I am 
using a sqllite jdbc driver (link below) and this works when using with only 
one entity. As soon as I add a sub-entity it falls over with a locked DB error: 
"java.sql.SQLException: database is locked".
Now I realize that you can only have one connection open to SQLite at a time. 
So I assume that the first query is leaving a connection open before it moves 
onto the sub-query. I am not sure if the issue would be in the jdbc driver or 
the DIH. It works fine with SQL Server.

Is this a bug? Or something that just isn't possible with SQLite?

Here is a sample of my data config file:
<dataConfig>
  <dataSource type="JdbcDataSource" 
              driver="org.sqlite.JDBC"
              url="jdbc:sqlite:SolrImportTest.db" />
  <document>
    <entity name="locations"
                        pk="id"
                        query="select * from locations">
                <field column="Id" name="Id" />
                <field column="Name" name="Name" />             
                <field column="RegionId" name="RegionId" />
                <entity name="regions"
                                pk="id"
                                query="select * from regions where id = 
'${locations.RegionId}'"
                        <field column="Name" name="RegionName" />
                </entity>
    </entity>
  </document>
</dataConfig>

sqllite jdbc driver : http://www.zentus.com/sqlitejdbc/

Reply via email to