Chapter 3. Special setups

3.1. Setting up Persistence for Business Central

Red Hat JBoss BPM Suite is configured to use an example datasource with Java Naming and Directory Interface (JNDI) name java:jboss/datasources/ExampleDS. For Business Central, this example datasource is located in the file business-central.war/WEB-INF/classes/META-INF/persistence.xml.
If you want to configure JBoss BPM Suite to use an external database, make the following changes. For file business-central.war/WEB-INF/classes/META-INF/persistence.xml:
  1. Install the respective Java Database Connectivity (JDBC) driver using modular approach for easy subsequent configuration (see EAP 6 documentation).
  2. Create a new datasource according to the example in EAP 6 documentation, section 6.7.1. Example PostgreSQL Datasource. This is the default used H2 database specific datasource configuration:
     <subsystem xmlns="urn:jboss:domain:datasources:1.1">
             <datasources>
                <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
                   <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
                   <driver>h2</driver>
                   <security>
                      <user-name>sa</user-name>
                      <password>sa</password>
                   </security>
                </datasource>
                <drivers>
                   <driver name="h2" module="com.h2database.h2">
                      <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                   </driver>
                </drivers>
             </datasources>
  3. Use the JNDI name of the datasource to update the following entry inside the persistence.xml file, which is by default set to this entry.
    <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>

    Important

    When configuring your datasource, make sure to enable JTA (typically, by adding jta="true" to the datasource tag).
  4. Replace the following text with the appropriate database specific hibernate dialect name.
    <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
    For example, for an Oracle Database Express Edition 11g, it would be:
    <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />

Note

When JBoss BPM Suite uses Oracle 11 as the datasource, multiple warning (WARN) messages are produced in the logs, without any corresponding Business Central activity being performed. This is expected behavior. To turn off these messages, set the level of the org.hibernate.loader category of the logger to ERROR in the standalone.xml file:
<logger category="org.hibernate.loader">
  <level name="ERROR"/>
</logger>