Adding an isolation level
You can use the deployment descriptor editor to add an isolation level to an EJB 2.0 CMP entity bean.
To add an isolation level to an EJB 2.0 entity bean with container-managed persistence:
- Switch to...
J2EE perspective | Project Explorer | EJB JAR file | Open With | Deployment Descriptor Editor | Access page- Scroll to the Isolation level section and click Add.
- The Add Isolation Level wizard appears.
- Select a type of isolation level from the following choices:
Isolation Level Description Repeatable read Prohibits dirty reads and nonrepeatable reads, but it allows phantom reads. Read committed Prohibits dirty reads, but allows nonrepeatable reads and phantom reads. Read uncommitted Allows reading uncommitted changes (data changed by a different transaction that is still in progress). It also allows dirty reads, nonrepeatable reads, and phantom reads. Serializable Prohibits the following types of reads:
- Dirty reads, in which a transaction reads a database row containing uncommitted changes from a second transaction,
- Nonrepeatable reads, in which one transaction reads a row, a second transaction changes the same row, and the first transaction rereads the row and gets a different value, and
- Phantom reads, in which one transaction reads all rows that satisfy an SQL WHERE condition, a second transaction inserts a row that also satisfies the WHERE condition, and the first transaction applies the same WHERE condition and gets the row inserted by the second transaction.
- Click Next.
- Select one or more enterprise beans from the list of beans found, then click Next. The enterprise beans selected here are the ones whose methods you want to assign to the isolation level.
- Select one or more of the method elements from the list.
- Click Finish.
The isolation level is added. To remove the isolation level, select it and click the Remove button.