On May 26, 9:43 am, Michael Bayer <mike...@zzzcomputing.com> wrote:
> You can expire the attribute manually ahead of time if you want it to reload 
> its value (should be fine within after_commit).

No, it seems that in after_commit the newly added instance is not yet
in session.identity_map, so session.expire throws an exception:
"InvalidRequestError: Instance '<Story at 0x102e46ad0>' is not
persistent within this Session". At this point I'm confused. Why would
it not be persistent after a commit? (If I remove the extra code, the
Story is persisted just fine, so it's not like the transaction is
failing without the extension.)

-- 
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