Adding method-level access intent for EJB 2.0 entity beans

Access intent for EJB 2.0 entities is the replacement in the EJB 2.0 specification for the EJB 1.0 access intents and EJB 1.0 isolation levels.

There are two general methods for adding access intent to EJB 2.0 enterprise beans:

To add method-level access intent to an EJB 2.0 enterprise bean:

  1. In the Project Explorer view, right-click the desired EJB module, and click select Open With > Deployment Descriptor Editor from the pop-up menu.

  2. On the Access page of the editor, click the Add button in the Access Intent for CMPs 2.x (Method Level) section. The Add Access Intent wizard appears.

  3. In the Name field, type a name for the new access intent.

  4. In the Access intent name field, select an access intent type from the drop-down list.

  5. Type a description for the new access intent.

  6. If you select one of the following access intent names, you can also select the Read Ahead Hint check box. This option adds the ability to preload related enterprise beans across relationships in a single query.

    • wsPessimisticUpdate-WeakestLockAtLoad

    • wsPessimisticUpdate-NoCollision

    • wsPessimisticRead

    • wsOptimisticUpdate

    • wsOptimisticRead

  7. Click Next.

  8. On the Enterprise Bean Selection page, select one or more enterprise beans from the list of beans found, then click Next. If you selected Read Ahead Hint, you will get a warning if no read ahead hint can be set for the selected bean. You might need to go back and clear the Read Ahead Hint check box.

  9. On the Method Elements page, select one or more of the method elements for the security identity. If you selected Read Ahead Hint, then Next is enabled. On the EJB Preload Paths page, set the preload of related EJBs by selecting the relationship roles by the selected bean.

  10. Click Finish.

The access intent is added. To remove the access intent, select it and click the Remove button.