On Nov 14, 2011, at 10:14 PM, Chris McDonough wrote:

> On Mon, 2011-11-14 at 20:30 +0100, Vlad K. wrote:
>> For worse I'd say because using SQLAlchemy directly works just fine and 
>> as expected, without the need to reload the data after failed session.
> 
> By the way, are you sure about this?  I've heard that when you commit or
> abort a "raw" SQLA session, the outcome is the same.  Objects loaded
> from a finished SQLA session become invalidated without the
> "expire_on_commit=False" (not the default) argument to the sessionmaker.
> Am I wrong about that?


The SQLA session invalidates everything after a commit or a rollback.   If 
expire_on_commit=False, then you're OK after the commit, but still if the 
rollback happens, everything is expired.    There's a way to turn that off too 
but then you're really in the "you're doing it wrong" area.

Overall, the use case here I thought was to use begin_nested(), i.e. SAVEPOINT. 
   Nothing gets expired when you commit on a SAVEPOINT since you're still 
within the original transaction.




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

Reply via email to