-
1. Re: TreeCache data integrity across cluster
manik Jul 21, 2006 12:48 AM (in response to magicmac)No, we don't have an explicit mechanism of obtaining a cluster-wide lock.
A local lock is obtained on method invocation and is maintained till your transaction ends (commits or rolls back).
Locks on remote instances are obtained and released during the 2-phase commit. (The prepare call attempts to acquire locks and updates data; the commit phase releases locks)
If the prepare phase cannot acquire the remote locks it needs within the given time (specified by the LockAcquisitionTimeout attribute) you see TimeoutExceptions.
You could also see TimeoutExceptions when trying to acquire the local lock if you have a lot of concurrent threads accessing the data.
You may want to try OPTIMISTIC locking, which greatly improves concurrency - at the cost of the occasional transaction failure due to validation clashes when updating concurrently accessed data.
Cheers,
Manik