0

We've an enhancement to use document level locking functionality with MongoDB like 'Select for Update' concept in oracle.Can any of you explain how it can be achieved using java driver?

  • WiredTiger already offers document level locking, see https://docs.mongodb.com/manual/faq/concurrency/ – D. SM Jul 07 '20 at 11:52
  • As far as "select for update", the typical suggestion is to rewrite your application to accomplish what you need done differently. – D. SM Jul 07 '20 at 11:54
  • We have to use document locking in transactions and this blog "https://www.mongodb.com/blog/post/how-to-select--for-update-inside-mongodb-transactions" says lock is obtained for concurrent writes and can be handled by retrying the transaction when we get writeconflict error.For Read operations,we should use findoneandUpdate() to accomplish locking.Is this how we lock documents? – prathyusha magam Jul 07 '20 at 18:41
  • The post you linked explains, what is your question? – D. SM Jul 07 '20 at 20:51

0 Answers0