Bobby Impollonia
unread,Mar 28, 2008, 1:28:17 PM3/28/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to TurboGears
If I am using SQLAlchemy with tg, is there a way to set the autoflush
and transactional attributes for my session?
I see that in database.py, sqlalchemy.orm.create_session is always
called with no arguments. As far as I know, the only way to set
transactional and autoflush is to pass them as kw arguments to this
function, so it looks like the sessions created by tg can't have these
attributes? DB config options in the cfg file end up getting passed to
sqlalchemy.create_engine and you can't set these options there, nor
can they go in the dburi (as far as I can tell).
As a side note, can someone explain why I wouldn't want autoflush? As
I understand it, autoflush flushes pending c/u/d operations
immediately before the next query, so it seems like the only extra
power you gain from not using it is the ability to query against dirty
data?