On 5/7/2015 11:59 AM, Siarhei Padolski wrote:
> I’m trying to import data using a read only account to an Oracle database.
> My data-config.xml is:
>
> <dataConfig>
>   <dataSource name="jdbc" driver="oracle.jdbc.OracleDriver"
>      url="jdbc:oracle:oci8:@//localhost:10010:CONNECTION"
>      user="ATLAS_PANDABIGMON_R"
>      password="Lutini72"
>      readOnly="true"
>      autoCommit="false" batchSize="100"
>      />
>   <document name="JOBSARCHIVED4">
>     <entity name="job" dataSource="jdbc" query="SELECT * from JOBSARCHIVED4 
> WHERE ROWNUM &lt; 1000">
>    </entity>
>   </document>
> </dataConfig>

<snip>

> Caused by: java.sql.SQLException: READ_COMMITTED and SERIALIZABLE are the 
> only valid transaction levels
>         at 
> oracle.jdbc.driver.PhysicalConnection.setTransactionIsolation(PhysicalConnection.java:3301)
>         at 
> org.apache.solr.handler.dataimport.JdbcDataSource$1.initializeConnection(JdbcDataSource.java:180)
>         at 
> org.apache.solr.handler.dataimport.JdbcDataSource$1.call(JdbcDataSource.java:158)
>         ... 16 more
>

Line 180 of JdbcDataSource.java in current code is this:

  c.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);

This transaction isolation level is apparently not allowed by your
Oracle server.

That code line is only executed if the "readOnly" parameter is in the
config.  Try taking out that line in your DIH config file.  Because the
SQL statement in your DIH config is SELECT, enforcing readOnly won'tbe
required.  DIH will only ever use the SQL statements that you provide. 
If the Oracle user you've indicated only has read-only access, then
that's another reason to leave readOnly out.

You've included a password in the config you sent to the list.  You
might want to change that password on any system that contains it ... a
lot of people have now seen it, and it will live forever on the Internet
in several archives of this mailing list.

Thanks,
Shawn

Reply via email to