![]() |
|
This is the default configuration for entity beans. A single bean instance is created irrespective of the number of concurrent requests. Server ensures serialization of requests to the bean instance. The bean is either loaded fresh before the start of a transaction or obtained from a cache, depending on the type of access to the database.
Case1: Exclusive DB, Performance Advantage
An exclusive lock on the instance state in the database is postponed till an ejbStore() callback occurs as part of the transaction commit operation. A delayed lock implies that locks to the database are maintained for a limited time. Performance is enhanced because of limited database resource usage. The entity bean’s state can be cached achieving load optimization. This mechanism should be used only when updates to the database happen through entity bean.
Case2: Non-Exclusive DB
At the start of a transaction, a bean is loaded fresh and an exclusive lock acquired on the particular row in the database. This mechanism should be used when the updates to the database are done externally from non-EJB or non-application clients.
Related Topics:
| © Pramati Technologies 2007 | Runs on Pramati Server | Feedback | Legal |