[8.5.0.2 or later]

Configuring heterogeneous SQL statement batching for JPA applications

Heterogeneous SQL statement batching is an improvement over the org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager. This functionality can improve the performance of your JPA application because it allows multiple different SQL statements to be sent to the database in a single batch. For example, if you have a transaction that updates one Entity and also inserts another Entity, when you use the BatchingConstraintUpdateManager function, two different batches are sent to the database: one for the update and another for the insert. In the same scenario, if you use the HeteroConstraintUpdateManager function, only one batch, which contains both operations, is sent to the database.

About this task

To enable the heterogeneous SQL statement batching function, you must:

Procedure

Define the UpdateManager property in the persistence.xml file
For example:
<property name="openjpa.jdbc.UpdateManager" 
   value="com.ibm.ws.persistence.jdbc.kernel.HeteroConstraintUpdateManager(batchLimit=250)"/>

In this example the SQL statement batch limit is set to 250.

The default batch limit is 100.

Results

You have now updated the persistence.xml file to enable heterogeneous statement batching.
Task topic    

Terms and conditions for information centers | Feedback

Last updated: April 17, 2014 10:32 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-express-iseries&topic=tejb_configjpa_hetsql
File name: tejb_configjpa_hetsql.html