Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2697

QueryCache doesn't work when use external cache storages

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.0, 2.2.2, 2.3.0, 2.4.0, 2.4.1, 2.4.2
    • Fix Version/s: None
    • Component/s: datacache
    • Labels:
      None

      Description

      When query object is de-serialized from external cache storage, it report error when de-serialized QueryKey. Check following code in QueryKey (2.2.0). _query is assumed to be String in readExternal(), but _query is not always String object.

      private static QueryKey createKey(QueryContext q, boolean packed,
      Class<?> candidateClass, boolean subclasses, long startIdx, long endIdx, Object parsed) {
      ...
      key._query = q.getQueryString();
      if (key._query == null)

      { // this can be a criteria query key._query = parsed; }

      }
      public void readExternal(ObjectInput in)
      throws IOException, ClassNotFoundException

      { _candidateClassName = (String) in.readObject(); _subclasses = in.readBoolean(); _accessPathClassNames = (Set<String>) in.readObject(); _query = (String) in.readObject(); _ignoreChanges = in.readBoolean(); _params = (Map<Object,Object>) in.readObject(); _rangeStart = in.readLong(); _rangeEnd = in.readLong (); _timeout = in.readInt (); }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              zanezhang123 Zane Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: