Thanks for the quick reply!

On Nov 12, 2010, at 7:41 PM, Michael Bayer wrote:

> mm, right there that's not the default behavior.  If you did an add(A), the 
> next query() you do will autoflush.  "A" is now in the database within the 
> scope of the current transaction, so query() will find it.

Yes, I have autoflush=False. A typical script for me is to load a batch of 
files into our database. If there is any problem with processing any of the 
files, I want the commit to fail - I don't want a partial import. I'd rather 
fix the problem and do another batch import (because I don't want to write a 
bunch of code checking how much was written and where to pick up from). I 
definitely don't want a query() to be a write operation.

Or is this a case where a nested transaction would be appropriate?

Cheers,
Demitri

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

Reply via email to