OpenJPA
  1. OpenJPA
  2. OPENJPA-1727

QueryCache TIMESTAMP eviction policy doesn't evict a timed out query if it returns zero results.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.1.0
    • Fix Version/s: 2.1.0
    • Component/s: None
    • Labels:
      None

      Description

      In QueryCacheStoreQuery.checkCache() if the query result has no result, we return Collections.emptyList(). This is a problem when using the TIMESTAMP eviction policy because we skip the section of code that looks at the timestamp to evict stale entries.

        Activity

        Hide
        Rick Curtis added a comment -

        Committed revision 980963 to trunk.

        Show
        Rick Curtis added a comment - Committed revision 980963 to trunk.
        Hide
        Rick Curtis added a comment -

        Reopening while looking at an intermittent test case failure.

        Show
        Rick Curtis added a comment - Reopening while looking at an intermittent test case failure.
        Hide
        Rick Curtis added a comment -

        I'm guessing that the failure has to do with the fact that in QueryCacheStoreQuery.checkCache(...):147 we compare the timestamp of the query to the timestamp of each of the results, but when the timestamps are equal we will use the cached result. I changed the comparison so that if/when the timestamp of the query is the same as one of the results we will throw out the cached result. I'd rather error on the side of hitting the database than returning stale data.

        I'm going to leave this JIRA open for a while to make sure that the test failure goes away.

        Show
        Rick Curtis added a comment - I'm guessing that the failure has to do with the fact that in QueryCacheStoreQuery.checkCache(...):147 we compare the timestamp of the query to the timestamp of each of the results, but when the timestamps are equal we will use the cached result. I changed the comparison so that if/when the timestamp of the query is the same as one of the results we will throw out the cached result. I'd rather error on the side of hitting the database than returning stale data. I'm going to leave this JIRA open for a while to make sure that the test failure goes away.
        Hide
        Rick Curtis added a comment -

        Looks like the fix worked. Resolving this issue again.

        Show
        Rick Curtis added a comment - Looks like the fix worked. Resolving this issue again.
        Hide
        Michael Dick added a comment -

        Closing issues which have been resolved for some time. If the problem persists, please reopen.

        Show
        Michael Dick added a comment - Closing issues which have been resolved for some time. If the problem persists, please reopen.

          People

          • Assignee:
            Rick Curtis
            Reporter:
            Rick Curtis
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development