The WSO2 Governance Registry has been tested to work with various relational database management systems including,
- H2 (Embedded and Server)
- Apache Derby (Embedded and Server)
- MS SQL Server
- IBM DB2
$GREG_HOME/repository/conf/registry.xml refers to a database configuration defines at
$GREG_HOME/repository/conf/datasources/ master-datasources.xml as given below.
The server administrator can define the type of database to be used, along with the JDBC connection URL to connect to the database and a compatible driver via the database configuration parameters in the
master-datasources.xml as given below.
The JDBC URL of the registry database is used in construction of cache keys. The cache keys are case sensitive, and therefore, you might run into caching issues if you do not consider the case.
Mandatory Configuration Elements
url- The URL of the database.
username- The name of the database user.
password- The password of the database user.
driverClassName- The fully qualified Java class name of the JDBC driver to be used.
maxActive- The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit.
maxWait- The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception, or <= 0 to wait indefinitely.
minIdle- The minimum number of active connections that can remain idle in the pool, without extra ones being created, or 0 to create none.
Optional Configuration Elements
validationQuery- This is used to validate the DB connection to test whether its healthy (For example,
SELECT 1 FROM DUALin Oracle).
testOnBorrow- The indication of whether objects will be validated before being borrowed from the pool.
validationInterval- The specified time interval for validations to run.
Therefor all the database configurations should be defined in the
master-datasources.xml . The database configurations that are needed to be define inside the
user-mgt.xml should also be pointed to the configurations defined in the
master-datasources.xml. You can find the database configurations for the different databases here.
There can be more than one database configuration specified within the
master-datasources.xml file. For instance, you can have something similar to the configuration below.
However, the server can only handle one active configuration at a time. The
currentDBConfig parameter defined in the
registry.xml is used to specify the database configuration that is active at present.
The value of the
currentDBConfig parameter should be a valid name of a database configuration defined on the
registry.xml file. An administrator can gain a number of benefits by being able to switch between database configurations.
- The ability to create back-up databases that can be activated by a simple configuration change resulting in minimal downtime.
Ease of development with the ability of testing on multiple database systems.