Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-2882

EntityList cache clearing issues when removing generic entity via DelegatorImpl

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Invalid
    • Trunk
    • None
    • framework
    • None

    Description

      For more information refer to http://ofbiz.135035.n4.nabble.com/EntityList-cache-issues-td206907.html

      Ran into some trouble when we turned out caching and started to dependent on the EntityList cache. The two problems were:

      1) When attempting to storeHook to the entityListCache or entityObjectCache via the Cache.remove method, the NEW entity was being passed into the OLD entity. This caused condition matching (in the list cache) to sometimes fail if a matched entity no longer matches do to it being modified.

      2) During the matching logic the EntityJoinOperator was incorrectly short circuiting. It was always checking if the lhs/rhs condition was true and if so returning the short-circuit value. A concrete example is as such – (A is funny) && (B is funny). The short-circuit value for this expression is "FALSE" which means that if the first expression is FALSE we short-circuit and return FALSE. What was happening was "if (A is funny) then return FALSE" rather then "if (A is funny == FALSE) then return FALSE".

      I have a patch in the works for both of these issues and will include a unit tester that illustrates the problems (pre-patch) and passes successfully (post-patch).

      Attachments

        1. OFBIZ-2882_EntityCacheListFix_V2.patch
          3 kB
          Bob Morley
        2. OFBIZ-2882_EntityCacheListFix.patch
          4 kB
          Bob Morley
        3. OFBIZ-2882_EntityCacheListTest_V2.patch
          4 kB
          Bob Morley
        4. OFBIZ-2882_EntityCacheListTest.patch
          4 kB
          Bob Morley

        Activity

          People

            jleroux Jacques Le Roux
            bmorley Bob Morley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: