#280 Cache Bug

closed-fixed
Oleg Broytman
None
5
2013-05-27
2013-05-22
Andrew
No

I think the caching call on line 1693 of main.py may be broken because it references 'id' instead of 'self.id' and 'id' isn't defined locally so it's referencing the global built-in function 'id'.

Discussion

  • Oleg Broytman
    Oleg Broytman
    2013-05-22

    • assigned_to: Oleg Broytman
    • Group: SQLObject_from_repository --> SQLObject_release_(specify)
     
  • Oleg Broytman
    Oleg Broytman
    2013-05-22

    You are right, it must be self.id. Thank you! I'll fix it ASAP.

     
  • Oleg Broytman
    Oleg Broytman
    2013-05-27

    • status: open --> closed-fixed
     
  • Oleg Broytman
    Oleg Broytman
    2013-05-27

    The problem was not only with self.id but that every SQLObject instance has a weak proxy to itself and pickling does strange things — it calls __getstate__ twice on pickling and calls __setstate__ twice on unpickling. The second call to __setstate__ is certainly a source of problems with cache.

    I fixed the problem by avoiding pickling the weak proxy and restoring the proxy on unpickling. Committed in the revisions 4601, 4602 (branch 1.3), 4603 (1.4), 4604 (the trunk).

    Thank you very much for helping to find and fix he problems!