Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BEGIN;
- do all the work for a single action
- COMMIT;
- BEGIN;
- if not enough funds, ROLLBACK and exit
- UPDATE to take money from one account
- UPDATE to add that money to another account
- INSERT into some log or audit trail to track all transactions
- COMMIT;
- BEGIN;
- SELECT some stuff from a row FOR UPDATE;
- test the stuff, such as account balance
- UPDATE that same row;
- COMMIT;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement