Hi,

a common pattern for me is to encounter a ProgrammingError or other
exception on autoflush. Then the point in my code at which I made a
booboo has already passed and so is not indicated by the stack trace.
If the cause isn't obvious, I will go rerunning the failing test,
inserting session.flush() at strategic places before the offending
code path, to narrow down where the bad DB operation really happens.

Is it feasible to add a mode like autoflush='eager' on the session?
Meaning that any operation that will result in an autoflush does so
immediately. Terrible in general, but a useful mode to enable for
debugging cases like this.

Downsides I imagine: (a) check constraints may be violated on
intermediate states being flushed (e.g. two properties need to be
updated together but in this mode wouldn't be), and (b) a check for
this state might need to be in a critical path, nibbling at runtime
performance. But Michael/others will know better than me whether these
are real hindrances.

Regards,

    - Gulli

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@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