Start here. This is the direct spoken answer to practice first.
Overview
Aligns SQLAlchemy transactions with business operations and uses savepoints without inventing independent commits.
A transaction covers one database consistency boundary: all changes that must succeed or fail together. I normally begin it in the application service or unit-of-work boundary, call lower-level data functions without letting each one commit, and finish with commit or rollback in one place. I keep unrelated network calls and user think time outside the transaction because they extend lock and connection ownership.