Hey Everyone,

I'm new to SQLAlchemy (used to using Django's ORM but need to switch)
and there's just one thing I'm struggling with, which is when am I
supposed to create Sessions? I am of course creating "scoped
sessions". I feel like a real dunce for not being able to get my head
around it.

Do I create one per-request and pass it around? That just doesn't feel
quite right to me. Or can I create them at module-level when I need
them? Also, is it okay to call commit() more than once on the same
session? On a per-function basis even (seems like an awful lot of
boilerplate code in each function though… surely not?!)

Sorry if I'm rambling, I just don't get when I'm supposed to
instantiate a new session =) I know this is probably something really
simple that most people get instantly.

Kind regards

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to