From: Ian B. <ia...@co...> - 2003-04-17 03:08:20
|
Okay, I see the problem: def testPurge1(self): x = CacheSet() y = Something() obj = x.get(1, y.__class__) self.assertEqual(obj, None) x.put(1, y.__class__, y) j = x.get(1, y.__class__) self.assertEqual(j, y) x.purge(1, y.__class__) j = x.get(1, y.__class__) print "Got %r" % j So when you do that last .get, you've locked the cache and you don't do a put to unlock it. So that's an error in how you're using CacheSet/CacheFactory. I've changed it slightly so that you can use try:finally: to protect against this, which SQLObject instances now do. I suspect some error was happening during instantiation of some object, and that's what was causing the bug. Ian |