Mongo - Custom pessimistic locking mechanism

Problem:

Having one thread updating a document at a time.

Solution:

Lock manager:


, lock implementation:


, how to:
1) check if the document is locked
2) acquire the lock
3) release the lock


Comments

Popular posts from this blog

Hibernate - HibernateException: createQuery is not valid without active transaction