OverviewLocking of objects occurs in multi-user systems to preserve the integrity of changes, so that changes made by one process do not accidentally overwrite changes made by another process. Blocking RulesBlocking Rules OverviewSpace operations have rules that specify whether they should be blocked if another operation takes place in parallel. Space operations can accept a transaction object, and this object can effect locking behavior. These rules should be considered very carefully when building space-based applications, especially in scenarios with many concurrent users.
Read OperationA read lock guarantees that an object is not changed while you are looking at it. It is useful when you want to look at an object but not change it. A read lock provides its guarantee by blocking all other requests for an update and take operation; it does not block other read requests. A request for a read operation is only blocked if the object already has an update operation. Update OperationAn update lock guarantees that you are the sole user of an object and that you are looking at the most up-to-date version of an object. It is useful when you want to update an existing object. An update lock provides its guarantee by blocking all other requests for a read, take or update lock on a particular object. Conversely, a request for an update lock is blocked if the object already has a read, take or update lock. Take OperationThe take operation behaves much like the read operation, except that a matching entry is also removed from the space. A take lock provides its guarantee by blocking all other requests for read, take and update operations. A request for a take operation is blocked if the object already has an update lock, read lock or take lock. Clear OperationThe clear operation behaves much like the take operation, except that a matching entry is not sent back to the client. A clear lock provides its guarantee by blocking all other requests for read, take and update operations. A request for a clear operation is blocked if the object already has an update lock, read lock or take lock. Operations with a Null TransactionIn general, when a space operation is called with a null transaction object, its scope is limited to the entry or entries passed to the operation. Any other space operations, with or without a transaction, can be executed without any blocking. More in this Section
|
![]() |
GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence |