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:
- Switch to the J2EE perspective.
- In the Project Explorer view, select the desired EJB module.
- Right-click on the Deployment Descriptor Editor and
select Open With from the pop-up menu.
- 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.
- In the Name field, type a name for the new
access intent.
- In the Access intent name field, select
an access intent type from the list.
- Type a description for the new access intent.
- 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
- 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.
- 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.
- In the Deferred Operation section, select ALL .
(You must select All to use the batch option.)
- Check the Batch check box.
- Click Next.
- 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.
- 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.
- Click Finish.
The access intent is added. To remove the access intent, select it
and click the Remove button.