+

Search Tips   |   Advanced Search

 

Set partial update for container-managed persistent beans

 

For EJB 2.x CMP entity beans, you 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.

 

Procedure

  1. Start the Application Server Toolkit.

  2. Open the J2EE perspective to work with J2EE projects. Click Window > Open Perspective > Other > J2EE.

  3. Open the Project Explorer view. Click Window > Show View > Project Explorer.

  4. Open the EJB Deployment Descriptor. Click EJB Projects > project > ejbModule > META-INF > ejb-jar.xml. The Deployment Descriptor editor opens.

  5. In the Deployment Descriptor editor, select the Access tab. The access page opens.

  6. In the Default Access Intent for Entities 2.x (Bean Level) section of the access page, select the bean for which you want to set partial operation. If an access intent has already been configured for this bean, click on the Edit button to edit the access intent policy. Otherwise, click on the Add button to add an access intent policy to the bean. This opens the Add access intent window.

  7. Select the Persistence Option check box if it is not already checked.

  8. Select the Partial Operation check box. Use the drop-down list next to the Partial Operation check box to select your preference.

    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.

  9. Select Finish.