Documentation - Database Configuration - 2014-08-18
Documentation - Database Configuration - 2014-08-18
com)
Database configuration
Product version:
6.3
Product edition:
Teamwork
Efficiency
Performance
Database usage
Business Data data sources
Default h2 database
Database creation
Specify db vendor
Add the database driver
Configure the datasource
Change to another database (not default h2)
Specific database configuration - PostgreSQL
Specific database configuration - MS SQL
Specific configuration database- MySQL
Specific configuration database - Oracle DB
Database usage
Bonita BPM Engine uses a database to store information about deployed processes definition,
processes configuration, history of process execution, users, etc. One database schema is
required by Bonita to store all information.
Connection to the database is through Hibernate (version 4.2). This provides a level of
abstraction between Bonita and DBMS. Bonita comes with a set of optimized initialization
scripts for the supported DBMSs.
Bonita also relies on the JTA (Java Transaction API) JEE service. This service is not available
in a standard Tomcat setup because it is not a full JEE application server. In order to get JTA
support in Tomcat, Bonita includes the Bitronix library.
Bonita BPM Engine use two data sources:
Hibernate data source
Used to store Java objects in a database.
Uses transaction provided by JTA.
Uses Hibernate for conversion between Java object to SQL queries.
Sequence data source
Used to get unique id for persisted objects.
Does not use JTA.
Does not use Hibernate (only runs standard SQL queries).
Default h2 database
Bonita BPM Studio, and the Tomcat and JBoss bundles come with a default h2 database
included in the package.
h2 is suitable for testing only. For production purposes, you should modify the configuration to
use another database.
In order to configure Bonita BPM to work with your DBMS, you will need to perform the
following steps:
Database creation
Specify the database vendor
Add the database driver
Configure data source
Remove h2
DBMS specific configuration
Database creation
Warning: Some databases require specific configuration, which must be done before you
complete your installation. If you do not complete the specific configuration for your database,
your installation may fail.
Note: You will need to have already created a new "Bonita" database that you can name as
you like, as long as you remember to "point to it" in your configuration file.
Note: the new Bonita database name you use will be needed in the following configuration
steps.
Also note that owner of the new schema must have following privileges:
CREATE TABLE
CREATE INDEX
SELECT, INSERT, UPDATE, DELETE on created TABLE
Note: CREATE TABLE and CREATE INDEX are no longer required after first start.
See also Set up a database schema with SQL Server 2012
See also Create a schema (Transact-SQL)
Property value
MySQL
mysql
MS SQL
sqlserver
PostgreSQL
postgres
Oracle database
oracle
h2
Download link
MySQL
download
download
download
Oracle Database
download
Note that if you run on Linux, JDBC driver might also be available in the distribution packages
repository. On Ubuntu and Debian you can for example install the libpostgresql-jdbcjava package to get the PostgreSQL JDBC Driver (install in /usr/share/java ).
MySQL
com.mysql.jdbc.Driver
com.mysql.jdbc.jdbc2.optional.MysqlXAD
Microsoft
com.microsoft.sqlserver.jdbc.SQLServerDriver com.microsoft.sqlserver.jdbc.SQLServerX
SQL Server
PostgreSQL org.postgresql.Driver
org.postgresql.xa.PGXADataSource
Oracle
Database
oracle.jdbc.driver.OracleDriver
oracle.jdbc.xa.client.OracleXADataSource
h2 (not for
production)
org.h2.Driver
org.h2.jdbcx.JdbcDataSource
Tomcat
Configuration of data source for Tomcat is a little bit specific. As Tomcat doesn't support JTA
natively, one data source will be configured in the Bitronix configuration file and the other data
source will be configured in the standard Tomcat context configuration file.
JTA data source (managed by Bitronix)
Open /conf/bitronix-resources.properties file.
Remove or comment the lines regarding the h2 database.
Uncomment the line matching your DBMS.
Update the value for the following settings:
resource.ds1.driverProperties.user put your DBMS user name.
resource.ds1.driverProperties.password put your DBMS password.
resource.ds1.driverProperties.serverName put the address (IP or
hostname) of your DBMS server.
resource.ds1.driverProperties.portNumber put the port of your DBMS
server.
resource.ds1.driverProperties.databaseName put the database name.
Save and close the file.
Non-transactional data source
The second data source run SQL queries outside any transaction. To configure it:
Open /conf/Catalina/localhost/bonita.xml file.
Remove or comment the lines regarding h2 database.
Uncomment the line matching your DBMS.
Update following attributes value:
username with your DBMS user name.
two data sources: the XA data source called bonitaDS and the no-tx data source called
bonitaSequenceManagerDS
Open the /server/default/deploy/bonita-ds.xml file.
Remove or comment the 2 blocks regarding the h2 database ( and ) as above.
Go to Examples, and uncomment the line matching your DBMS.
Update value for the following settings in :
with your DBMS user name.
with your DBMS password.
with the address (IP or hostname), port of your DBMS server, and database name.
5. Update value for the following settings in :
with your DBMS user name.
with your DBMS password.
with the address (IP or hostname), port of your DBMS server, and database name.
Save
and close the file.
6.
1.
2.
3.
4.
If you want to change the default h2 database to another, you will need to go through the
following steps to remove h2.
Remove h2 listener, so that H2 is not started automatically.
Tomcat: comment out the H2 listener in the /conf/server.xml file.
JBoss: remove the mbean declaration in the
server/your_server_configuration/deploy/bonita-ds.xml file
Remove h2 jar files (bonita-jboss-h2-mbean-1.0.0.jar, bonita-tomcat-h2-listener1.0.1.jar, h2-1.3.170.jar)
Tomcat: files are located in: /lib or in /lib/bonita.
JBoss: files are located in: server//lib
To make sure that the H2 is not run, go to run.conf.batfile in /bin/ and in "set
Bonita OPTS", remove the part which refers to H2.
10. Execute following command in SQL editor: USE master GO CREATE USER
'bonitadev', 'bonitadev' GO sp_addrolemember [SqlJDBCXAUser],
'bonitadev'
11. In Windows "Start" menu select Administrative Tools-> Services.
12. In "Services" window, make sure that the Distributed Transaction Coordinator service
is set to start automatically. If it's not yet started, start it.
13. Also make sure that the other services it depends on, namely "Remote Procedure Call"
and "Security Accounts Manager" are also set to start automatically.
14. Then run dcomcnfg command or go inside "Start" menu to Administrative Tools >
Component Services.
15. In the left navigation pane, navigate to Component Services > Computers > My
Computer > Distributed Transaction Coordinator
16. Select and right-click on Local DTC and thenProperties.
17. Click on Security tab. Ensure that the checkbox for Enable XA Transactions is
checked.
18. Click Apply then OK
19. Then stop and restart SQLServer.
20. Create BONITA_v6 database CREATE DATABASE BONITA_v6 GO
21. Set bonitadev as owner of BONITA_v6 database (use for example: 'Microsoft SQL
Management Studio')
1.1 Check that the following components exist and are valid:
SQL query >
select comp_name, version, status from dba_registry;
Comp_name
Version
Status
11.2.0.1.0
VALID
11.2.0.1.0
VALID
11.2.0.1.0
VALID
Oracle XDK
11.2.0.1.0
VALID
11.2.0.1.0
VALID
11.2.0.1.0
VALID
11.2.0.1.0
VALID
2. Add XA elements
SQL query >
@/u01/app/oracle/product/11.2.0/dbhome_1/javavm/install/initxa.sql
This only needs to be done once, after the installation of Oracle.
3. Create user to be used by the Bonita Engine and grant the proper rights
SQL query >
@/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin/xaview.sql
The following queries must be done for each new user: i.e. one user = one database schema.
SQL query >
CREATE USER bonita IDENTIFIED BY bonita; GRANT connect, resource TO
bonita IDENTIFIED BY bonita; GRANT select ON
sys.dba_pending_transactions TO bonita; GRANT select ON
sys.pending_trans$ TO bonita; GRANT select ON sys.dba_2pc_pending TO
bonita; GRANT execute ON sys.dbms_system TO bonita; GRANT select ON
sys.v$xatrans$ TO bonita;