Chapter 4. Persistence Setups

4.1. Configuring Persistence for Business Central

Red Hat JBoss BPM Suite is configured to use an example data source with Java Naming and Directory Interface (JNDI) name java:jboss/datasources/ExampleDS. The example data source is not suitable for production.

To change the data source:

  1. Prepare your database:

    1. Go to the Product Downloads on the Customer Portal and select Red Hat JBoss BPM Suite.
    2. Download Red Hat JBoss BPM Suite 6.3.0 Supplementary Tools.
    3. Unzip jboss-brms-bpmsuite-6.3-supplementary-tools/ddl-scripts, for example into /tmp/ddl.
    4. Import the DDL script for your database into the database you want to use, for example:

      psql jbpm < /tmp/ddl/postgresql/postgresql-jbpm-schema.sql
  2. Install the Java Database Connectivity (JDBC) driver onto your application plaform. For example, to deploy a PostgreSQL JDBC driver:

    1. Copy your JDBC jar file into EAP_HOME/modules/org/postgres/main/.
    2. Create EAP_HOME/modules/org/postgres/main/module.xml with the following content:

      <?xml version="1.0" ?>
      <module xmlns="urn:jboss:module:1.1" name="org.postgres">
              <!-- Change the name of the JDBC driver to match yours. -->
              <resource-root path="postgresql-9.4-1202.jdbc42.jar"/>
              <module name="javax.api"/>
              <module name="javax.transaction.api"/>

      For further information about deploying JDBC drivers, see Install a JDBC Driver as a Core Module of the Red Hat JBoss Enterprise Application Platform Administration and Configuration Guide.

  3. Create a new data source:

    1. Open EAP_HOME/standalone/configuration/standalone.xml and locate <datasources>.
    2. Add your data source and the driver:

      <!-- Default data source not suitable for production, now disabled. -->
          <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="false" use-java-context="true">
          <!-- The new data source configuration. -->
          <datasource jndi-name="java:jboss/datasources/PostgresqlDS" pool-name="PostgresqlDS" enabled="true">
          <!-- The drivers section. -->
              <driver name="h2" module="com.h2database.h2">
              <!-- Register your new driver. -->
              <driver name="postgres" module="org.postgres">

      For more information, see Example PostgreSQL Datasource of the Red Hat JBoss Enterprise Application Platform Administration and Configuration Guide.

  4. Register the data source in Business Central:

    1. Open EAP_HOME/standalone/deployments/business-central.war/WEB-INF/classes/META-INF/persistence.xml.
    2. Locate the <jta-data-source> tag and change it to the JNDI name of your data source, for example:

    3. Locate the <properties> tag and change the hibernate.dialect property, for example:

      <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />