Partial column updates for container managed persistence

Previously, the WAS implementation of the Container Managed Persistence (CMP) bean method ejbStore always stored all of the persistent attributes of the CMP bean to the database, even if only a subset of persistent attribute fields were changed. This needless performance degradation is eliminated in this release of the product.

For Enterprise JavaBeans (EJB) 2.x CMP entity beans, we can use the partial update feature to specify how you want to update the persistent attributes of the CMP bean to the database. This feature is provided as a bean level persistence option, called PartialOperation, in the access intent policy configured for the bean. PartialOperation has two possible values:

NONE
Partial update is turned off. All of the persistent attributes of the CMP bean are stored to the database. This is the default value.
UPDATE_ONLY
Specifies that updates to the database occur only for the persistent attributes of the CMP bean that are changed.
For information on how to set partial update, see Setting partial update for container-managed persistent beans .

Affects on performance

Performing partial updates increases performance in several ways:

Although partial update improves performance in general, it can adversely affect performance too.

Considerations for using partial update

The performance gains you hope to achieve should be weighed against the possible instances where degradation can occur. We can use the following guidelines to help you make the decision.

Restrictions

By default, batch update of update queries is disabled for all CMP beans for which partial update is enabled. In other words, partial update takes precedence over batch update. Batch update of delete and insert queries is not affected.

Batch update performance is affected when both batch update and partial update persistence options are used on the same bean, because each partial query is different. We can use the JVM property -Dcom.ibm.ws.pm.grouppartialupdate=true to group the similar partial update queries into a batch update. Grouping of partial updates only helps when there are several partial queries with the same shape in a transaction. Otherwise, grouping partial updates has the opposite affect on performance. Because this setting is not on a bean level basis, you should be careful when turning it on. Because this affects all beans that have both partial update and batch update on, make sure that batch update of partial queries does indeed increase performance when viewed across all the beans for which both updates are on.

So you should determine which situation gives the best performance for your application: batch update only or partial update only or both (with grouppartialupdate flag set to true).

To set the JVM property:

1. Open the server.xml file.
2. Change the value of -Dcom.ibm.ws.pm.grouppartialupdate=true to 
                       -Dcom.ibm.ws.pm.grouppartialupdate=false.