Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-2812

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 3.4
    • None
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hollandlef Lucian Holland
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: