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

RDBMSDataConnector defaults to readOnly connections

    XMLWordPrintable

    Details

    • Type: Documentation
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.1
    • Fix Version/s: 3.3.0
    • Labels:
      None
    • Environment:

      tomcat-jdbc-7.0.54.jar org.apache.tomcat.jdbc.pool.DataSource

    • Operating System:
      Multiple
    • Java Version:
      Other OpenJDK 7
    • Servlet Container:
      Apache Tomcat 7

      Description

      Hi,

      I've run into an issue when trying to run a 3.2.1 IdP with a dc:RelationalDatabaseConnector and with a shibboleth.StoredPersistentIdGenerator using the same DataSource.

      I was getting failures from the StoredPersistentIdGenerator about the connection being readOnly.

      I've just tracked this down to RDBMSDataConnector having readOnlyConnection default to true:

          /** Whether the JDBC connection is read-only. */
          private boolean readOnlyConnection = true;
      

      In the retrieveAttributes method, RDBMSDataConnector makes the connection read-only - but this connection then stays in the DataSource pool. If another client requests a connection from the pool, it gets the same connection - which is however marked readOnly. At least, this is the behavior I'm getting with org.apache.tomcat.jdbc.pool.DataSource.

      My workaround was to create separate DataSources copying the same configuration via bean inheritance:

      <bean id="vho.DataSource" parent="shibboleth.JPAStorageService.DataSource" />
      <bean id="shibpid.DataSource" parent="shibboleth.JPAStorageService.DataSource" />
      

      I now see I could have also added readOnlyConnection="false" to the RelationalDatabaseConnector definition.

      But I think this is worth reporting - it is an undesired side-effect on the DataSource pool.

      Cheers,
      Vlad

        Attachments

          Activity

            People

            Assignee:
            rdw@iay.org.uk Rod Widdowson
            Reporter:
            tuakiriadmin-vmencl@virtualhome.tuakiri.ac.nz Vladimir Mencl
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2 hours
                2h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes Time Not Required
                30m