Batch commands for container managed persistence

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 versions 5.0.2 and later enable you to take advantage of this. We 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.

The WAS v6.0 enables you to make the same settings using the Application Server Toolkit (AST).

 

See also


Setting the run time for batched commands with JVM arguments
Setting the run time for batched commands with the assembly tools