DataImportHandler doesn't always honour readOnly="false" on JdbcDataSources
---------------------------------------------------------------------------

                 Key: SOLR-2812
                 URL: https://issues.apache.org/jira/browse/SOLR-2812
             Project: Solr
          Issue Type: Bug
          Components: contrib - DataImportHandler
    Affects Versions: 3.4
            Reporter: Lucian Holland
            Priority: Minor


When JdbcDataSource creates a new connection, it checks to see if its 
properties have readOnly="true". If it does, it sets the new JDBC connection to 
be read-only. But the converse is not true, presumably because it assumes that 
all newly created connections will be writable by default. This assumption does 
not always hold. In my case, I was using container-managed connections with 
Tomcat 6.0 which has a connection pool by default. Occasionally, DIH would get 
a previously pooled connection that was readOnly. I discovered this because I 
was doing some Evil Badness that meant the DIH was actually writing to the DB 
as well as reading from it, which I imagine is a very non-standard use case. 
Nonetheless it would seem uncontroversial for JdbcDataSource to 
setReadOnly(false) explicitly.

I'm sorry, it's kind of hard to provide a simple test case for this without 
writing a dummy Jdbc driver or constructing a much more elaborate scenario, but 
hopefully the issue is simple enough that this won't matter.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to