Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updating JDBC connections

...

Configure an external database server such as MySQL as the persistence storage instead of embedded H2 database. Although slight performance gains can be experienced when using simple BPEL processes with H2 database, it cannot handle multiple concurrent requests and complex processes with the same efficiency.

 

JDBC connections

JDBC connections are useful when your application requires high throughput.

BPS has two three engines; Apache ODE BPEL processor, HumanTask engine and HumanTask Activiti BPMN engine. These two engines are tightly coupled with the database layer and their function is to persist instance data into the database. Thus, for BPS to function properly, you need to allocate enough database connections for BPS datasource . Both these engine share configurations. 

BPS Datasource 

Both Apache ODE BPEL processor and HumanTask engine share same BPS datasource and database connections so we generally recommend allocating 50% of database connections for each engine for an application running with both BPEL and HumanTask.

For example if you have a total 100 database connections for a BPEL and HumanTask application, you can use upto 50 database connections for the ODE engine and leave the rest of the database connections for HumanTask operations. If you have only BPEL in your application, you can allocate many more database connections for the ODE engine.

Note

Also note that, even you have allocated higher number of database connections for the BPS datasource, performance may not increase as expected. One reason for this could be that there are not enough database sessions from the database side. If that is the case, you need to increase the number of database sessions from database side.

Configure the BPS datasource by editing the <BPS_HOME>Configure the BPS datasource by editing the <BPS_HOME>/repository/conf/datasources/bps-datasources.propertiesxml file and changing the followingthe maxActive value .

.

synapse.datasources.bpsds.validationQuery=SELECT 1 FROM DUAL synapse.datasources.bpsds.dsName=bpsds synapse.datasources.bpsds.maxActive=100 synapse.datasources.bpsds.maxIdle=20 synapse.datasources.bpsds.maxWait=10000
Code Block
languagexml
  <datasources>
        <datasource>
            <name>BPS_DS</name>
            <description></description>
            <jndiConfig>
                <name>bpsds</name>
            </jndiConfig>
            <definition type="RDBMS">
                <configuration>
                    <url>jdbc:mysql://localhost:3306/bpsds</url>
                    <username>root</username>
                    <password>root</password>
                    <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                    <testOnBorrow>true</testOnBorrow>
                    <validationQuery>SELECT 1</validationQuery>
                    <validationInterval>30000</validationInterval>
                    <useDataSourceFactory>false</useDataSourceFactory>
                    <defaultAutoCommit>true</defaultAutoCommit>
                    <maxActive>100</maxActive>
                    <maxIdle>20</maxIdle>
                    <maxWait>10000</maxWait>
                </configuration>
            </definition>
        </datasource>
    </datasources>

 

Activiti Datasource 

Activiti BPMN engine uses Activiti datasource.  Similar to BPS datasource you can allocate many more database connections for BPMN engine as necessary.  

Configure the Activiti datasource by editing the <BPS_HOME>/repository/conf/datasources/activiti-datasources.xml file and changing changing the maxActive value .

Code Block
languagexml
    <datasources>
        <datasource>
            <name>ACTIVITI_DB</name>
            <description>The datasource used for activiti engine</description>
            <jndiConfig>
                <name>jdbc/ActivitiDB</name>
            </jndiConfig>
            <definition type="RDBMS">
                <configuration>
                    <url>jdbc:mysql://localhost:3306/activity</url>
                    <username>root</username>
                    <password>root</password>
                    <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                    <maxActive>50</maxActive>
                    <maxWait>60000</maxWait>
                    <testOnBorrow>true</testOnBorrow>
                    <validationQuery>SELECT 1</validationQuery>
                    <validationInterval>30000</validationInterval>
                </configuration>
            </definition>
        </datasource>
    </datasources>
Note

Also note that, even you have allocated higher number of database connections for datasources, performance may not increase as expected. One reason for this could be that there are not enough database sessions from the database side. If that is the case, you need to increase the number of database sessions from database side.

ODE scheduler threads

ODE scheduler threads are useful when your application requires high throughput.

...