On Dec 1, 2007, at 9:33 AM, Koen Bok wrote:
> > This is quite hackish, but just an experiment for me. > > We use listen/notify in our app. A seperate thread is listening for > notifications from updated rows in the table. If one is received I'd > like to expire an object in the Session cache so it gets refetched the > next time it is accessed. I have it working, but I get a lot of these: > > AttributeError: 'ReceiveRequest' object has no attribute > '_instance_key' > > I guess that's because the background thread is marking objects as > expired while the main thread is performing actions on them. _instance_key doesn't get removed by the expire operation, so thats something else. i notice youre iterating through the whole session which will return objects from "new" as well, so you might want to iterate just through session.identity_map.values() there. also i dont understand the point of that little iterate through session.registry.registry but the main idea seems OK. --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---