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.

About this task

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.

Procedure

  1. Switch to the Java™ EE perspective.
  2. In the Enterprise Explorer view, expand your EJB 2.x project and double-click the Deployment Descriptor node.
  3. On the Access page of the EJB deployment descriptor editor, under the Access Intent for Entities 2.x (Method Level Deprecated) section, click Add.
  4. In the Name field of the Add Access Intent wizard, type a name for the new access intent.
  5. In the Access intent name field, select an access intent type from the list. For details on these access intent types, see the table in the Access intent assembly settings topic available from the WebSphere® Application Server product documentation.
  6. Type a description for the new access intent.
  7. 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
  8. 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.
  9. 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.
  10. Click Next.
  11. 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 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.
  12. 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.
  13. Click Finish.

Results

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

Feedback