do the read/write operations from the db should be in a transaction
`redeemVoucher' reads stuff from the db, makes decisions and then writes to the db. However if there is another client doing a simultaneous `redeemVoucher' for the same `voucher', then both of them would redeem the voucher, which is incorrect. The operations should have exclusive access to the db and this is achieved with `withExclusiveTransaction`.
Loading
Please register or sign in to comment