Re: [SQLObject] Enduring long queries outside SQLObject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Frank B. <fb...@fo...> - 2003-11-06 19:32:38
|
Hallo, Ian Bicking hat gesagt: // Ian Bicking wrote: > Using 0.5 you should be able to .expire() the instances. > DBConnection.Transaction.rollback does this, and you could probably > separate that code out, maybe make an expireAll method on DBConnection > instances. Ultimately that method should also find all sub-connections > (i.e., transactions), each of which have their own cache and set of > instances, but that's probably not an issue for you using MySQL. Thank you for that tip. You're thinking about something as this: ##### def expireAll(Caches): # subCaches = [(sub, sub.allIDs()) for sub in self.cache.allSubCaches()] subCaches = [(sub, sub.allIDs()) for sub in Caches] for subCache, ids in subCaches: for id in ids: inst = subCache.tryGet(id) if inst is not None: print " -- Expiring %s\n%s" % (inst.id, inst) inst.expire() x = Product(45) y = Product(103724) c = Product._connection.cache.allSubCaches() expireAll(c) ###### I will try that. ciao -- Frank Barknecht _ ______footils.org__ |