On May 17, 2006, at 7:40 AM, Oleg Broytmann wrote:

On Fri, May 12, 2006 at 12:10:22PM -0700, David Creemer wrote:
Can I humbly request that the part of the patch that at least applies
to problem #2 above be applied to the 0.7-bugfix release?

   I tried. No way:

[SQLObject-0.7/sqlobject/tests/test_cache.py:36]
      CacheTest.sqlmeta.expireAll()

E [failure to get at sourcelines from <TracebackEntry /home/phd/ work/SQLObject/SQLObject-0.7/sqlobject/tests/main.py:576>]
  AttributeError: 'sqlmeta' object has no attribute 'expireAll'

   I copied .expireAll() from the trunk:

E [failure to get at sourcelines from <TracebackEntry /home/phd/ work/SQLObject/SQLObject-0.7/sqlobject/tests/main.py:576>]
  AttributeError: 'CacheSet' object has no attribute 'weakrefAll'

So, if you want the patch to be backported - do all necessary copying,
test and submit a proper patch.



Ok -- no problem. Here's a patch against 0.7-bugfix that *only* fixes the bug of never culling the cache. I hope the patch format is fine -- it's just the output of svn diff. The test_cache.py test runs without error for me.


Index: sqlobject/cache.py
===================================================================
--- sqlobject/cache.py  (revision 1769)
+++ sqlobject/cache.py  (working copy)
@@ -97,6 +97,8 @@
                 # method has a lock, so it's threadsafe.
                 self.cullCount = 0
                 self.cull()
+            else:
+                self.cullCount += 1
             try:
                 return self.cache[id]



Oleg.


-- David

---
David Creemer
http://www.zachary.com





-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to