Uploaded image for project: 'Identity Provider'
  1. Identity Provider
  2. IDP-831

Missing DataConnector/@readOnlyConnection

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Duplicate
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.2.0
    • Component/s: Attribute Resolver
    • Labels:
      None

      Description

      Not sure this is a bug but since it worked in IDPv2 (unless I'm confused) I'll start there:

      When trying to get the IDP to work with an sqlite database (using the Xerial JDBC driver) and ContainerManagedConnections (defaultReadOnly not being set) I get an error from the resolver, due to sqlite seemingly not reacting well to setReadOnly=true (unconditionally?) being called on the Connection:

      2015-10-05 13:54:17,209 - ERROR [net.shibboleth.idp.profile.impl.ResolveAttributes:256] - Profile Action ResolveAttributes: Error resolving attributes
      net.shibboleth.idp.attribute.resolver.ResolutionException: Data Connector 'dbnames': Unable to execute SQL query
              at net.shibboleth.idp.attribute.resolver.dc.rdbms.impl.RDBMSDataConnector.retrieveAttributes(RDBMSDataConnector.java:147)
      Caused by: java.sql.SQLException: Cannot change read-only flag after establishing a connection. Use SQLiteConfig#setReadOnly and SQLiteConfig.createConnection().
              at org.sqlite.jdbc3.JDBC3Connection.setReadOnly(JDBC3Connection.java:112)
      

      That seems to be a well-known issue for the sqlite JDBC drivers available, e.g.

      possibly stemming from the JDBC driver being overly strict for something considered merely a "hint" for "optimization" purposes:

      "setReadOnly – Puts this connection in read-only mode as a hint to the driver to enable database optimizations." Java SQL API

      Anyway, with IDPv2 I could set resolver:DataConnector/readOnlyConnection="false" to work around this issue, AFAIR. Setting this in v3 does not have any obserable effect, though.

      Was this dropped on purpose? Is there use for this even outside (admittedly, in my own case) toy deployments using sqlite?

      N.B. I could work around this in IDPv3 by reverting from sqlite-jdbc-3.8.11.1.jar to a previous release of the JDBC driver, as versions before 3.7.15-M1 don't react this way. E.g. sqlite-jdbc-3.7.2.jar seem to work with IDPv3, though there may be other issues due to missed code fixes in newer releases.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dfisher@vt.edu Daniel W Fisher
              Reporter:
              peter@aco.net Peter Schober
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: