The SQLAlchemy Session - In Depth
summary
Argues SQLAlchemy’s Session replaces fragile active‑record patterns by enforcing explicit transactions, keeping a single identity map per operation, and using a unit of work to lazily flush and sort INSERT/UPDATE/DELETE in the correct order to satisfy FK and NOT NULL constraints. Demonstrates an HTML5 animation built from SQLAlchemy events showing add/flush/commit/expire cycles across connections; the demo runs and visualizes how objects go transient→pending→persistent→expired.
AI-written summary · about
chapters (29)
- 0:00Introduction
- 2:00ACID Model
- 6:46Active Record
- 12:54Immediate
- 14:46Consistency
- 15:48ActiveRecord
- 17:36Most Dense Example
- 20:03Rain
- 20:18Session Strategy
- 20:36Session Rows
- 21:12Session Objects
- 21:46Pending Changes
- 21:59Row Proxy
- 22:39Expired Objects
- 23:13New Objects
- 23:24Cursed
- 23:41Unit of Work
- 24:32Where this doesnt come from
- 24:43Where this comes from
- 25:36Identity Map
- 26:40The Unit of Work
- 27:04Flush
- 27:29Rollback
- 28:51Explicit Transactions
- 29:31Live Session Demo
- 29:52Address Object
- 31:07Demo
- 37:04Maintaining sanity
- 39:35Isolation levels
