Concurrency in MongoDB transactions

@Shanka_Somasiri,

We have a specific section that explains how to read and lock a document for this scenario.

The main idea is that when you load a sheet you will adda locking field which will result in a tx lock. Therefore, other transactions will lock or abort when reading. I suggest for a more smooth experience wait a small period and retry this abort again by reloading the user view.

Once the transaction is commited by user A user B will use a read commited read isolation and will only read the data after a successful commit or rollback.

Please let me know if you have any additional questions.

Best regards,
Pavel

1 Like