'Serializing a procedure - Calling multiple times at the exact moment (PL/SQL)
So, here's the issue:
We have a procedure that, at first, calls another procedure to see the amount this person still haves at that exact moment. If he have the enough value, we then call another procedure to use this amount, updating the value.
This seems pretty basic, but we are having concurrency problems - The program that calls the procedure is executing 2, 3, 4 times with different values at the exact hour/minute/second, making this a little mess (sometimes, the person have the amount for each individual process, but not for all 3 combined).
I need to, somehow, serialize this procedure so they cant execute all together at the same time, so when the process searches for the amount it's already updated.
Obs: Controlling the caller to execute one at a time is not possible, unfortunately - The dev team that supports the application calling the procedure can't do this, for God knows the reason why...
What's the better option to do something like this? I know it's kinda basic, but is there any more intelligent solutions (I'm considering locking a row, so all other executions have to wait the release)?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
