Skip Headers

# Using Read-Only Entity Beans

Previous

Next

TopLink can declare an entity bean with container-managed persistence as read-only. This ensures that the entity bean cannot be modified and allows TopLink to optimize unit of work performance.

If an attempt is made to modify a read-only entity bean (create, update, or remove), TopLink immediately throws a `javax.ejb.EJBException`: TopLink does not wait until the transaction commits.

If an attempt is made to change a CMR field on a read-only entity bean, TopLink throws a `javax.ejb.EJBException`.

When TopLink is configured as the OC4J persistence manager, the TopLink read-only bean configuration replaces the OC4J `READ-ONLY` CMP concurrency mode.