Batch commands for container managed persistence

 

Overview

From JDBC 2.0 on, PreparedStatement objects can maintain a list of commands that can be submitted together as a batch. Instead of multiple database round trips, there can be only one database round trip for all the batched persistence requests.

The WAS version 5.0.2 enables you to take advantage of this. You can turn this option on from the EJB CMP side. When you choose this option, the run time defers ejbStore/ejbCreate/ejbRemove or the equivalent database persistence requests (insert/update/delete) until they are needed. This can be at the end of the transaction, or when a flush is needed for finders related to this EJB type. When the persistence operation finally happens, run time accumulates the database requests and uses JDBC PreparedStatement batch operation to make a single JDBC call for multiple rows of the same operation.

 

Set the run time for batched commands

  1. Go to...

    Console | Servers | Application Servers | server | Process Definition | Java Virtual Machine

  2. Update the Generic JVM arguments with:

    -Dcom.ibm.ws.pm.batch=true