Lock on session start level with provided keys
Scenario:
Parallel DB updates with transactions on multiple collections that use same documents.
Example: Calculate some common stuff to embed it in extra collections to avoid lookups.
Problem:
Lock and timeout on documents uses up valuable time and performance.
Also lock conflicts produce a huge amount of exceptions that need to be handled.
Idea:
Key-based sessions
Example:
Session A with Keys 1 and 2 is started.
Session B tries to start with Key 1. Key 1 is locked with Session A. Session B waits till Session A is finished.
In this case transaction doesn't start with updating and failing. Waiting for session doesn't use up resources.
7
votes
![](https://secure.gravatar.com/avatar/fd7f63f035945031d7b8dbab3deb4190?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)