A detailed walkthrough of SQLAlchemy's Session, describing the rationale for its existence, its driving philosophies, and finally a walkthrough of Session lifecycle through the use of an animated diagram. We'll cover how the relational database refers to database rows within a transaction, and how the Session has over the years developed a tight, proxied integration with this lifecycle.
Intro
The problem of object persistence
Persistence Strategies
ad-hoc
managed
Transactions
Isolation
autocommit
SQLAlchemy Patterns
Identity map
unit of work
proxy pattern
History
"objectstore" / thread local
Session
autoflush / autoexpire / transactional
Influences
Fowler
Python ORMs
Hibernate
JPA / JSR-220
Detailed Demo
Intro to live animation demo
Description of areas
object state
database
connection / isolated transaction
session
session transaction
new, dirty, deleted, identity map
Step by step
transient objects
populate attributes
pending objects
flush
population of isolated rows / sync of attributes
persistent objects
commit isolated rows to permanent
expire
teardown
lazy refresh
lazy load
modify attribute
flush
update isolated rows
commit isolated rows to permanent