> Updating a customer's winnings and recording a win are definitely things that should be together in a transaction - if one happened and not the other, that's a failure.
Yes, they these clearly do belong in the same transaction. Inserting a congratulations email into the email queue doesn't.
emails typically get fired off as part of a post-commit hook. Pyramid's transaction manager has explicit support for this pattern - as you establish "emails" within your trans, the actual send operation is deferred til after the transaction proceeds.
Yes, they these clearly do belong in the same transaction. Inserting a congratulations email into the email queue doesn't.