biao li
biao li

Reputation: 121

Does GridGain support backup of distributed lock?

So far I know GridGain supports distributed lock. Is distributed lock based on distributed cache? Does GridGain support backup of distributed lock, like distributed map?

Thanks, Bill

Upvotes: 0

Views: 63

Answers (1)

Dmitriy
Dmitriy

Reputation: 2292

Yes, distributed lock is acquired by calling GridCacheProjection.lock(...) method, so it will have as many backups as there have been configured for cache.

However, locks do not have transactional semantics, and it is always more advisable to use cache transactions via any of the GridCacheProjection.txStart(...) methods. This way you you still get the locking semantics, but will also be able to commit or rollback your transaction atomically.

Upvotes: 1

Related Questions