Program guide > Access data with client applications > Programming for transactions
Use locking
Locks have life cycles and different types of locks are compatible with others in various ways. Locks must be handled in the correct order to avoid deadlock scenarios.
- Locks
Locks have life cycles and different types of locks are compatible with others in various ways. Locks must be handled in the correct order to avoid deadlock scenarios.
- Implement exception handling in locking scenarios
To prevent locks from being held for excessive amounts of time when a LockTimeoutException exception or a LockDeadlockException exception occurs, an application must ensure that it catches unexpected exceptions and calls the rollback method when something unexpected occurs.
- Configure a locking strategy
You can define an optimistic, a pessimistic, or no locking strategy on each BackingMap in the WebSphere eXtreme Scale configuration.
- Configure the lock timeout value
The lock timeout value on a BackingMap instance is used to ensure that an application does not wait endlessly for a lock mode to be granted because of a deadlock condition that occurs due to an application error.
- Locking performance best practices
Locking strategies and transaction isolation settings affect the performance of the applications.
- Map entry locks with query and indexes
This topic describes how eXtreme Scale Query APIs and the MapRangeIndex indexing plug-in interact with locks and some best practices to increase concurrency and decrease deadlocks when using the pessimistic locking strategy for maps.
Parent topic:
Program for transactions
Related concepts
Transaction processing overview
Optimistic collision exception
Run parallel business logic on the data grid (DataGrid API)