+

Search Tips   |   Advanced Search

Partial column update feature for container managed persistence

The Container Managed Persistence (CMP) bean method ejbStore 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.

Entity beans are not supported in EJB 3.0 modules.

For EJB 2.x CMP entity beans, we can use the partial update feature to specify how 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 Set partial update for container-managed persistent beans.


Performance

Performing partial updates increases performance in several ways:

Although partial update improves performance, it can adversely affect performance as follows:


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 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 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, you must make sure that batch update of partial queries does increase performance when viewed across all the beans for which both updates are on.

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.


Related tasks

  • Set partial update for container-managed persistent beans
  • Use access intent policies for EJB 2.x entity beans

  • Data source settings