Adding method-level access intent for entity 2.x beans

Access intent for Entities 2.x. is the replacement in the specification for the EJB 1.x access intents and EJB 1.x isolation levels.
There are two general methods for adding access intent to enterprise beans 2.x:
  • bean level access intent (Default): this default method for handling access intent based on the bean level should be used in most cases.
  • Method-level access intent: this advanced method for handling access intent based on methods should only be used in advanced situations.

To add method-level access intent to an entity 2.x bean:

  1. Switch to the J2EE perspective.
  2. In the Project Explorer view, select the desired EJB module.
  3. Right-click on the Deployment Descriptor Editor and select Open With from the pop-up menu.
  4. On the Access page of the editor, click Add in the Access Intent for Entities 2.x (Method Level) section. The Add Access Intent wizard appears.
  5. In the Name field, type a name for the new access intent.
  6. In the Access intent name field, select an access intent type from the list.
  7. Type a description for the new access intent.
  8. 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
    • wsPessimisticUpdate-NoCollision
    • wsPessimisticUpdate-Exclusive
    • wsPessimisticRead
    • wsOptimisticUpdate
    • wsOptimisticRead
  9. To set the persistence, click Persistence Option.
    • Verify Read Only Data: Select one of NONE, AT_TRAN_BEGIN, or AT_TRAN_END.
    • Deferred Operation: Select one of NONE, CREATE_ONLY, or ALL.
  10. Batch: This operation uses the JDBC batch command to insert, update, or delete rows in the database back end that this particular enterprise bean is connected to.
    1. In the Deferred Operation section, select ALL . (You must select All to use the batch option.)
    2. Check the Batch check box.
  11. Click Next.
  12. 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.
  13. 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.
  14. Click Finish.
The access intent is added. To remove the access intent, select it and click the Remove button.

Feedback