[jira] [Created] (OPENJPA-2697) QueryCache doesn't work when use external cache storages

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jira] [Created] (OPENJPA-2697) QueryCache doesn't work when use external cache storages

JIRA jira@apache.org
Zane Zhang created OPENJPA-2697:
-----------------------------------

             Summary: QueryCache doesn't work when use external cache storages
                 Key: OPENJPA-2697
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2697
             Project: OpenJPA
          Issue Type: Bug
          Components: datacache
    Affects Versions: 2.4.2, 2.4.1, 2.4.0, 2.3.0, 2.2.2, 2.2.0
            Reporter: Zane Zhang


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 ();
        }



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
Loading...