Database support
The EbMS Adapter supports the following databases:
H2 for test purposes
HSQLDB for test purposes
MS SQL Server (not recommended)
Database Scripts
The database master scripts can be found here
The database update scripts can be found here
ebms-core also supports automatic database migration through Flyway
Flyway
Database migration through Flyway is enabled through the following EbMS property
ebms.jdbc.update=true
If you already have an existing database and want to use Flyway, then you first have to initialize Flyway. Otherwise you can just enable the property.
Database Configuration
You can find the JDBC properties for the supported databases as well as links to the EbMS database plugins, JDBC drivers and Flyway database drivers below. You should add the properties to the EbMS override properties and add either add the EbMS database plugin or the JDBC driver and Flyway database driver to the classpath of ebms-admin when you start it. For example if you want to use PostgreSQL then either add ebms-postgres-db-plugin-2.20.6.jar to the classpath or add postgresql-42.7.3.jar and flyway-postgresql-12.0.4.jar to the classpath when you start ebms-admin.
Common Properties
ebms.jdbc.username=<username>
ebms.jdbc.password=<password>
DB2
# JDBC driver
ebms.jdbc.driverClassName=com.ibm.db2.jcc.DB2Driver
# or XA driver
ebms.jdbc.driverClassName=com.ibm.db2.jcc.DB2XADataSource
ebms.jdbc.url=jdbc:db2://<host>:<port>/<dbname>
Download the EbMS DB2 plugin here or download the JDBC drivers here and the Flyway DB2 driver here and add them to the classpath next to each other when you start ebms-admin.
H2
# JDBC and XA driver
ebms.jdbc.driverClassName=org.h2.Driver
# or XA driver
ebms.jdbc.driverClassName=org.h2.jdbcx.JdbcDataSource
# In memory
ebms.jdbc.url=jdbc:h2:mem:<dbname>
# or file
ebms.jdbc.url=jdbc:h2:<path>
# or server
ebms.jdbc.url=jdbc:h2:tcp://<host>:<port>/<path>
Download the EbMS H2 plugin here or download the JDBC drivers here and add it to the classpath next to each other when you start ebms-admin.
HSQLDB
# JDBC driver
ebms.jdbc.driverClassName=org.hsqldb.jdbcDriver
# or XA driver
ebms.jdbc.driverClassName=org.hsqldb.jdbc.pool.JDBCXADataSource
# In memory
ebms.jdbc.url=jdbc:hsqldb:mem:<dbname>
# or file
ebms.jdbc.url=jdbc:hsqldb:file:<path>
# or server
ebms.jdbc.url=jdbc:hsqldb:hsql://<host>:<port>/<dbname>
Download the EbMS HSQLDB plugin here or download the JDBC drivers here and the Flyway HSQLDB driver here and add them to the classpath next to each other when you start ebms-admin.
MariaDB
# JDBC driver
ebms.jdbc.driverClassName=org.mariadb.jdbc.Driver
# or XA driver
ebms.jdbc.driverClassName=org.mariadb.jdbc.MySQLDataSource
ebms.jdbc.url=jdbc:mariadb://<host>:<port>/<dbname>
Download the EbMS MariaDB plugin here or download the JDBC drivers here and the Flyway MariaDB driver here and add them to the classpath next to each other when you start ebms-admin.
MS SQL Server
We strongly advise to not use a MSSQL Database with the EbMS Adapter if you expect a moderate to high message load, because MSSQL cannot handle that because of Page Locking.
# JDBC driver
ebms.jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
# or XA driver
ebms.jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerXADataSource
ebms.jdbc.url=jdbc:sqlserver://<host>:<port>;[instanceName=<instanceName>;]databaseName=<dbname>;
Download the EbMS MS SQL Server plugin here or download the JDBC drivers here and the Flyway MS SQL Server driver here and add them to the classpath next to each other when you start ebms-admin.
XA Driver
When using the XA driver execute the following script
EXEC sp_sqljdbc_xa_install
EXEC sp_addrolemember [SqlJDBCXAUser], '<username>'
Quartz
When deliveryTaskHandler.type is set to QUARTZor QUARTZ_JMS then set
deliveryTaskHandler.quartz.jdbc.selectWithLockSQL=SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?
Oracle
# JDBC driver
ebms.jdbc.driverClassName=oracle.jdbc.OracleDriver
# or XA driver
ebms.jdbc.driverClassName=oracle.jdbc.xa.client.OracleXADataSource
ebms.jdbc.url=jdbc:oracle:thin:@<host>:<port>:<dbname>
Download the EbMS Oracle plugin here or download the JDBC drivers here and the Flyway Oracle driver here and add them to the classpath next to each other when you start ebms-admin.
XA Driver
When using the XA driver execute the following script
grant select on sys.dba_pending_transactions to <username>;
grant select on sys.pending_trans$ to <username>;
grant select on sys.dba_2pc_pending to <username>;
PostgreSQL
# JDBC driver
ebms.jdbc.driverClassName=org.postgresql.Driver
# or XA driver
ebms.jdbc.driverClassName=org.postgresql.xa.PGXADataSource
ebms.jdbc.url=jdbc:postgresql://<host>:<port>/<dbname>
Download the EbMS PostgreSQL plugin here or download the JDBC drivers here and the Flyway PostgreSQL driver here and add them to the classpath next to each other when you start ebms-admin.
XA Driver
If you get the following error when using the XA driver
org.postgresql.util.PSQLException: ERROR: prepared transactions are disabled Hint: Set max_prepared_transactions to a nonzero value.
then enable the max_prepared_transactions attribute in postgresql.conf