update account balance only after line creation is successful
Had instances where during Line creation, AccountWouldBeSentNegative is thrown. This rolled back the Line record but the balance update for AccountBalance wasn't getting rolled back. This made positive-only accounts go into negative balances without creating corresponding line item records.
Ideally we want to make sure all Line items are created successfully before we update the account balance. That way, when any error gets thrown while creating a Line record, we wouldn't worry about any updates to the Account Balance.
Isn't this all happening in a transaction anyway? I don't understand how this would possibly be happening ... could you perhaps write a failing test that passes after your changes?