Re: [SQLObject] Confused about caching
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Simon C. <hod...@gm...> - 2006-01-24 09:57:57
|
Hi Peter, I've recently investigated exactly the question you've asked. The answer I arrived at is: Setting cacheValues=3DFalse does exactly what the name suggests - it prevents caching of the values (fields) associated with an object. So with cacheValues=3DFalse obj.value retrieves value from the database.=20 With cacheValues set to True, obj.value main simply returns a cached value from the Python object. Notably, cacheValues has no effect on whether the objects themselves are retained in SQLObject's object cache. Explicitly removing an object from the object cache requires a call to obj.expire(). If there is a bug, it is that I would expect SQLObject's cache not to grow indefinitely. The reason it does is that the code to check the cache size is only called when something attempts to *fetch* an object from the cache. If you're only creating objects (as I was) then things are only added to the cache (never fetched) and the cache grows indefinitely unless you manually expire objects. Schiavo Simon -- oooooooooooooooooooooooooooooooooooooooooo [ hodgestar.za.net ] In the end, we all choose our own morality. oooooooooooooooooooooooooooooooooooooooooo |