On Mar 26, 2013, at 1:56 PM, Martin Davidsson <[email protected]> wrote:

> Hello,
> 
> For various reasons, I've configured my sessionmaker with autoflush=False, 
> expire_on_commit=False, autocommit=True. Mainly, I just want autocommit 
> behavior. The other flags are set due the warning in the SQLAlchemy docs:
> 
> In the absense of a demarcated transaction, the Session cannot make 
> appropriate decisions as to when autoflush should occur nor when 
> auto-expiration should occur, so these features should be disabled with 
> autoflush=False, expire_on_commit=False. 
> http://docs.sqlalchemy.org/en/latest/orm/session.html#autocommit-mode
> 
> Without the expire_on_commit behavior, I often find myself having to expire 
> objects manually so it would be nice to use expire_on_commit=True. My 
> question is, is this warning still accurate? expire_on_commit makes it sound 
> pretty clear when something expires so I don't know if it agrees with the 
> documentation.


sure, turn on expire_on_commit = True.  It will expire everything each time you 
call flush().


-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to