MongoDB Spring Pessimistic Lock

Viewed 1049

I'm trying to implement a Pessimistic lock on my Spring Boot application running with a MongoDB instance.

The problem:

User A, select the Document ID 123 User A, update the Document, append one field and Save it User B, select the Document ID 123 and need to wait User A finish the Save.

Is it possible do with MongoDB?!

1 Answers

I've found this post. On my tests, it looks like solve the problem.

But the Best approach is to use WebFlux with Mongo. Unfortunately, it's not possible on the project I'm running at this moment

Related