Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The JDBCStorageService is a database-leve level compatible replacement for the JPAStorageService and provides a Storage Service on top of an RDBMS.  It communicates directly with the with the database rather than using Hibernate ORM which has issues with reliability and the lack of provenance of its software artifacts.

...

  • Create the database table that for the plugin to use.

  • Download the appropriate JDBC driver.

  • (Optionally, but recommended) Download an a Connection PoolPooling implementation.

If you are moving from the JPAStorageService you do not need to make any changes to your database and you can use the same configuration for the DataSource as you did for the JPAStorageService.

...

Note

Whatever you do, you MUST ensure the context and id columns are case-sensitively handled and compared. That is a requirement of the API that will be using the database. This is frequently NOT the default behavior of databases such as MySQL.

The specific examples that follow should NOT be assumed to be functional, as they likely are the product of different sources, varying amounts of testing (including none), and may not be current. Drivers get updated frequently and JDBC and database bugs appear and disappear with regularity. When in doubt, always grab new ones when problems appear.

...

Expand
titleSQLServer
Code Block
CREATE TABLE StorageRecorStorageRecords  ds (
   context varchar(255) COLLATE Latin1_General_100_CS_AS NOT NULL,
   id varchar(255) COLLATE Latin1_General_100_CS_AS NOT NULL,
   expires bigint DEFAULT NULL,
   value varchar(255) NOT NULL,
   version bigint NOT NULL,
   PRIMARY KEY (context,id)
   );

...

You need to locate, download and verify the JDBC driver for your database and place it in edit-webapp/WEB-INF/lib.After populating edit-webapp/WEB-INF/lib you should execute execute bin/build.sh or bin/build.bat as appropriate for your environment.

Connection Pooling

We recommend the use of a DataSource that provides connection pooling, which may require installing an additional library as well.

...

Having located, downloaded and verified the connection pooling jar you should place it in edit-webapp/WEB-INF/lib.After populating edit-webapp/WEB-INF/lib you should execute execute bin/build.sh or bin/build.bat as appropriate for your environment

...

In the example below use of Commons DBCP is demonstrated ( classclass="org.apache.commons.dbcp.BasicDataSource", p:url="..." in the DataSource bean). When using other Connection Pool implementations change the class and properties appropriately, e.g.:

...

Code Block
    <bean id="my.dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" lazy-init="true"
       p:driverClassName="......"
       p:url="jdbc:hsqldb:mem:StorageService"
       p:username="shibboleth"
       p:retryableErrors="4001, 4002"
       p:password="%{JDBCPassword}" />

    <bean id="JDBCStorageService" parent="shibboleth.JDBCStorageService"
          p:dataSource-ref="dataSource"
          p:transactionIsolation="4"
          p:retryableErrors="40001"
     />

...