Here is my situation:
- I have 2 types of actions A & B, each read or update a single ressource.
- Actions A should be able to be executed concurrently.
- Actions A should wait for Actions B to be finished.
- Actions B should wait for Actions A to be finished.
- Actions B should wait for Actions B to be finished.
This is solved perfectly using FOR SHARE for Actions A, and FOR UPDATE on Actions B
My problem is the following:
- using this model, Actions B can be on hold indefinetely as long as new Actions A are coming through.
- I want that once an Action B is trying to acquire its LOCK, new Action A should be on hold.
Is there any way to achieve that?