+

Search Tips   |   Advanced Search

 

Configure read-read consistency checking with the assembly tools

 

Read-read consistency checking only applies to LifeTimeInCache beans whose data is read from another transaction. For the Access Intents that are for repeatable read (RR), this means the product checks that the data is consistent with that in the data store, and ensures that no one updates it after the checking.

 

Overview

For the Access Intents that are for read committed (RC), this means the product checks that the data is consistent at the point of checking, it does not guarantee that the data does not change after the checking. This makes the behavior of the LifeTimeInCache bean the same as non-LifeTimeInCache beans.

To perform this checking, configure CMP entity beans with read-read consistency checking. You can do this using the Application Server Toolkit.

 

Procedure

  1. Start the Application Server Toolkit.

  2. In the Project Explorer view of the J2EE perspective, right-click the Deployment Descriptor: EJB Module Name under the EJB module for the bean instance, then select Open With > Deployment Descriptor Editor. A property dialog notebook for the EJB project is displayed in the property pane.

  3. Select the Access tab. The Add Access Intent window appears. There are two areas of the panel that deal with adding access intent:

    • Default Access Intent for Entities 2.x (Bean Level)

    • Access Intent for Entities 2.x (Method Level)

  4. Select the Bean or Method level. Another access intent window appears where you can set the properties you wish to use.

  5. Use the dropdown list to select the Access intent name.

     

  6. Optional: Enter a description.

  7. Check the Persistence Option box.

  8. Check the Verify Read Only Data box.

  9. Use the dropdown list to select your choice for read-read consistency checking. You have three options:

    NONE

    No read-read checking is done.

    AT_TRAN_BEGIN

    During ejbLoad, if the data is from cache, check the database to ensure that the data of the bean (with proper locking based on access intent's concurrency control attribute) has not changed since the last load.

    AT_TRAN_END

    At the end of transaction, if the bean is not changed and did not load by the current transaction, check the database to ensure that the data of the bean has not changed from last load (with proper locking based on access intent's concurrency control attribute.) If the data has changed, fail the transaction.

  10. Select Finish.



Example: Read-read consistency checking