On May 27, 2010, at 11:55 AM, Dan Ellis wrote: > On May 26, 2:17 pm, Michael Bayer <[email protected]> wrote: > >> its in the identity map after the flush succeeds, which is well before >> after_commit() is called. > > That sounds reasonable, but I have debug output from after_attach, > before_flush, after_flush, before_commit and after_commit, all of > which show a session.identity_map without the newly added Story > instance. In fact, the only time I see a Story is as the 'instance' > argument to after_attach. But it's still doing the INSERT into the > stories table. > Here's my debug output: > http://pastie.textmate.org/private/ixa4sjopmf8nowblec1ra > Why would I be seeing that behaviour? Is it indicative of me having > set something up wrongly elsewhere?
if you can create a small test case for me illustrating a Foo object being added to the session, being flushed, and the after_commit() hook showing that it is not present in the identity map, I can work from that to explain why its happening. One thought is that the Session is weak referencing - if your Story (here Foo) object has lost all references, it will be garbage collected once flushed. So it depends on how you're checking for it. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
