On 1/24/06, Simon Cross <[EMAIL PROTECTED]> wrote: > Hi Peter, > > I've recently investigated exactly the question you've asked. The > answer I arrived at is: > > Setting cacheValues=False does exactly what the name suggests - it > prevents caching of the values (fields) associated with an object. So > with cacheValues=False obj.value retrieves value from the database. > 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.
Glad to hear that's what you found. It's not quite what I expected but as long as I understand this, I can work around it when needed. For now, using .expire() when my code needs to deal with creating large numbers of objects will work fine. If I get a bit of time, I'll also poke at what it would take to patch SQLObject so that the cache size check is also called when objects are inserted into the cache. - Peter ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ sqlobject-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
