|
J2EE Locking StrategiesIt often seems that one of the great mysteries in EJB development is the selection of an appropriate locking policy that meets both performance and data integrity requirements. This document attempts to demystify this area and allow you to choose the right strategy for your application. Data IsolationThis section describes the different isolation levels systems can exhibit and the their impact on the throughput of concurrent systems. Using Database LockingMany systems choose not to perform locking in the Application Server, but instead use the mechanisms built into the underlying database systems. This section describes the different solutions implemented by different database platforms, and how they can be used from inside the Application Server. Entity EJB LockingThis section covers the different locking strategies used by J2EE Application Servers to control concurrent access to Entity EJBs. It also covers configuring the JBoss server to use the different strategies. Using BMP EntitiesThis section describes the interactions between the EJB locking strategies in the Application Server and the locking strategies provided by a database. It highlights the issues that should be considered by developers writing Entities using Bean Managed Persistence and illustrates the SQL needed to ensure the global isolation level is preserved. Using CMP EntitiesWith Container Managed Persistence, the EJB container is responsible for ensuring the locking policy configured in the Application Server is correctly maintained by the SQL statements executed. This section describes how to configure CMP/JBoss to maintain the desired isolation level. Optimistic Web TransactionsThe very nature of Web applications requires careful consideration of locking policies for operations that require multiple page requests. This section illustrates the issues with Web interactions and how optimisitic concurrency controls can be used to ensure data integrity. |
|
||||||
© 2003 Core Developers Network Ltd "Core Developers Network", the stylized apple logo and "Core Associates" are trademarks of Core Developers Network Ltd. All other trademarks are held by their respective owners. Core Developers Network Ltd is not affiliated with any of the respective trademark owners. |