Versions Compared

Key

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

...

The JDBCStorageService is a direct, database-leve 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.

...

$ /opt/shibboleth-idp/bin/plugin.sh -i http://shibboleth.net/downloads/identity-provider/plugins/pluginName/version/URL

or

$ /opt/shibboleth-idp/bin/plugin.sh -i <plugin.tar.gz>

If installing from a local file, you need to ensure the GPG detached signature (e.g. the .asc file) is placed alongside the main plugin archive on disk.

Listing Installed Plugins

$ /opt/shibboleth-idp/bin/plugin.sh -l

or

C:>\opt\shibboleth-idp\bin\plugin.bat -l

Database Preparation

If you are not upgrading from a JPA storage JPAStorageService configuration you need to:

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

  • Download the appropriate JDBC driver and place it in .

  • (Optionally, but recommended) Download an Connection Pool.

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 the JPAStorageService.

Creating the Database

...

Expand
titleSQLServer
Code Block
CREATE TABLE StorageRecor  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 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

Configuration

You need to add the definition of a bean derived from shibboleth.JDBCStorageService into an appropriate configuration file (usually global.xml). The options you can provide to the bear are detailed below.

Expand
titleBehavioral Options

The behavior of the Storage Service is controlled by the following options

Option Property Name

Default

Description

dataSource

Required

The DataSource to use

cleanupInterval

0

The time between one cleanup and another. A value of 0 indicates that no cleanup will be performed.

retryableErrors

A comma separate list of SQL errors which will cause a failed transaction to be retried.

transactionIsolation

8 (Connection.TRANSACTION_SERIALIZABLE)

The level of transactional isolation required as described for the Connection Interface

transactionRetry

3

Number of retries if insertion fails due to database transaction bugs

verify

true

Whether to verify the database connection on startup

localLocking

false

Whether to do thread level locking to arbitrate access (for this IdP) to the the database. This can be useful in high contention situations when multiple transaction retries are happening.

...

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" 
          p:dataSource-ref="dataSource"
          p:transactionIsolation="4"
          p:retryableErrors="40001"
     />

...