Skip to content

Software Engineering

Transactions, Commits, and Rollbacks in SQLModel: A Mental Model That Actually Makes Sense

Every developer working with databases has experienced that frustrating moment when their application grinds to a halt because of connection issues or unexplained slowdowns.

If you've ever wondered why your SQLModel operations are crawling along or connections are being dropped, you're not alone.

The problem isn't your code's logic - it's how you're managing database sessions.

I learned this the hard way after creating bottlenecks by constantly opening new connections instead of properly managing and reusing sessions.

By the end of this post, you'll understand:

  • Why creating a new session for every operation kills performance
  • When exactly you should commit() or rollback()
  • A simple mental model that makes SQLModel transactions intuitive
  • Bulletproof patterns for managing database connections efficiently

The best part? You'll never again wonder why your application is suddenly crawling along due to connection pool exhaustion.

Vibes Fade, Knowledge Lasts: The Case Against Lazy Coding Culture

Every time I scroll through my Twitter feed lately, I'm bombarded with content celebrating "vibe coding" – the idea that you don't need deep technical knowledge anymore, just the right "vibes" and an LLM to generate your code.

Something about this trend doesn't sit right with me.

It's not professional jealousy. As someone who uses AI coding tools daily, I recognize their transformative potential. Rather, it's the underlying philosophy that troubles me – the casual dismissal of accumulated knowledge and the experts who built it.

While watching the anime Orb: On the Movements of the Earth recently, I had an epiphany about what specifically bothers me about vibe coding culture.