Google Groups Home
Help | Sign in
Message from discussion Using autoflush with SQLAlchemy?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Bobby Impollonia  
View profile
 More options Mar 28, 1:28 pm
From: Bobby Impollonia <bob...@gmail.com>
Date: Fri, 28 Mar 2008 10:28:17 -0700 (PDT)
Local: Fri, Mar 28 2008 1:28 pm
Subject: Using autoflush with SQLAlchemy?
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?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google