Skip Headers

Oracle® Containers for J2EE Orion CMP Developer's Guide 10g Release 3 (10.1.3) B19177-01 |
| Home | Solution Area | Contents | Index

Previous | Next |

# Configuring Exclusive Write Access to the Database

The`exclusive-write-access` attribute of the `<entity-deployment>` element (see Table A-1, "Attributes of the <entity-deployment> Element") states that this is the only entity bean that accesses its table in the database and that no external methods are used to update the resource. It informs the OC4J instance that any cache maintained for this bean will only be dirtied by this bean. Essentially, if you set this attribute to `true`, you are assuring the container that this is the only bean that will update the tables used within this bean. Thus, any cache maintained for the bean does not need to constantly update from the back-end database.

This flag does not prevent you from updating the table; that is, it does not actually lock the table. However, if you update the table manually or from another bean, the results are not automatically updated within this bean.

The default value of the `exclusive-write-access` attribute is `false`. Because of the effects of the entity bean concurrency modes (see "Configuring Concurrency Modes"), you can only set this element to `true` for a `read-only` entity bean. OC4J always resets this attribute to `false` for `pessimistic` and `optimistic` concurrency modes.

For more information, see the following:

- "Configuring Concurrency Modes".

- "Configuring Database Isolation Levels".

- "Avoiding Database Resource Contention".