Martijn Faassen wrote: > > Hey Michael, > > Cool that you managed to reproduce the issue. > > Michael Bayer wrote: > >> and a potential fix is this: >> >> Index: lib/sqlalchemy/orm/session.py >> =================================================================== >> --- lib/sqlalchemy/orm/session.py (revision 6289) >> +++ lib/sqlalchemy/orm/session.py (working copy) >> @@ -1018,7 +1018,7 @@ >> state.key = instance_key >> elif state.key != instance_key: >> # primary key switch >> - self.identity_map.remove(state) >> + self.identity_map.discard(state) >> state.key = instance_key >> >> self.identity_map.replace(state) >> Index: MANIFEST.in >> =================================================================== >> >> I guess the unit test for this would be, to do the operation in both >> ways >> so that the issue is indicated regardless of dictionary ordering. > > Yes, that seems like it would catch it. > > Anything I can do to make sure that a fix is in a 0.5.x release soon? I > could look into writing the unit test that demonstrates the problem; > would I do this on trunk?
so far I have been lining up ORM fixes for an 0.5.6 release, so this would target at the rel_0_5 branch as well as trunk. I think the test would need to be added to test/orm/test_naturalpks. time is very short these days so hopefully this weekend or next will present a stretch that I can get some fixes and maybe releases going. at the very least if you could add a trac ticket that's targeted at 0.5.6 with "high" priority it can be the next thing I look at. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---