I have a c# rest service which is distributed among across different servers. In the service I have a balance check for the incoming request amount and if balance is there, we proceed and create the transaction.
if(txnamount> balamount){
// return
}
else{
//create txn
}
The balance amount is calculated using the previous txn amounts. If bulk request comes in quick session, balance check condition fails when previous txn amount is not reduced from the balance. How to solve this