Show TOC Start of Content Area

Function documentation Isolation Levels  Locate the document in its SAP Library structure

Use

Isolation levels define the way in which container-managed entity beans are locked when you use Enqueue Server locking. Isolation levels specify the isolation between different transactions when  they access a common resource concurrently.

Integration

Isolation levels define the way, in which container-managed entity beans are locked, but the type of locking is described in the <locking> element in persistent.xml. For more information about specifying the types of locking, see Choosing the Type of Enqueue Server Locking.

Features

The isolation levels supported by the J2EE Engine are Read Committed and Repeatable Read.

Every transaction uses its own persistent object that contains a copy of the last committed state of the corresponding persistent entity. This object is loaded just once – the first time it is accessed by the transaction.

Dirty writes are prevented by locking in the Enqueue Server. An exclusive lock is set prior to the first update, which will be performed on the object.

If an object is loaded by a transaction with Repeatable Read isolation level, a shared lock is set on the object immediately after it is loaded. The lock becomes exclusive prior to the first update.

Activities

To set isolation levels for your container-managed entity bean methods, follow the steps below.

Note

The default isolation level is Read Committed, that is, if you do not specify an isolation level, the EJB Container will assume that Read Committed is specified.

In this procedure, you can only change the isolation level from Read Committed to Repeatable Read.

...

       1.      Open the ejb-j2ee-engine.xml.

       2.      Choose the Isolation Levels tab.

       3.      From the Isolation levels pane, select the repeatable read isolation level.

       4.      Choose add.

A Choose methods dialog box appears.

       5.      Choose the methods, for which you want to specify the corresponding isolation level. If you choose the whole entity bean, the isolation level will be applied to all the bean’s methods.

       6.      Choose OK.

The bean and the selected methods appear in a tree structure under the repeatable read isolation level. If you select all the bean’s methods, an asterix (*) appears as sub-node under the entity bean.

       7.      To specify the interfaces in which the selected business or home methods are declared, select the corresponding business or home method and choose the interface from the Affected interface drop-down list.

The SAP NetWeaver Developer Studio generates the specified values in the <isolation-level> element in ejb-j2ee-engine.xml.

For more information about the specific elements, see ejb-j2ee-engine.dtd.

 

 

End of Content Area