2 ms·
> you can't accept a withdrawal if the user doesn't have enough funds. You can. ATMs around the country aren't doing account-level locking. If you overdraw,
by mrkeen 3y ago
> you can't accept a withdrawal if the user doesn't have enough funds.
You can.
ATMs around the country aren't doing account-level locking. If you overdraw, you overdraw.
If you store the ledger operations (reliably! no half-writing them and then throwing an exception!), then your system knows what happened.
Having a ledger which you're confident about is more important than trying to use exceptions to prevent 'bad' ledger messages being written.
- amw-zero 3y agoMaybe an ATM allows that, because the max you can take out of an ATM is $500 or so. I don’t think you want to let a $500k withdrawal go through optimistically.