Hi there, we're using sqlalchemy from within a tornado application to access the database. To prevent us from accidentally stopping the single threaded server we adopted a usage pattern of sqlalchemy where we use it during startup to load various objects from the db, and then use background threads to load more as required.
Since we wanted an easy way to get errors when we accidentally break this pattern, we created a session that will raise when used and subclassed the ThreadLocalRegistry to make it easy to use it. Thus now Database access only works like this: with DatabaseAccess(): # do something to access the db and is nicely explicit and raises otherwise. We'd like to open source this (~100 loc + tests) perhaps as part of sqlalchemy or the wiki? What do you think, would this be useful to somebody? Best regards, Martin Häcker -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.