Revision 3357
Added by Jing Tao over 17 years ago
src/edu/ucsb/nceas/metacat/DBQuery.java | ||
---|---|---|
539 | 539 |
|
540 | 540 |
} |
541 | 541 |
logMetacat.warn("============ final selection query: " + query); |
542 |
|
|
542 |
String selectionAndExtendedQuery = null; |
|
543 | 543 |
// we only get cache for public |
544 | 544 |
if (user != null && user.equalsIgnoreCase("public") |
545 | 545 |
&& pagesize == 0 && MetaCatUtil.getOption("query_cache_on").equals("true")) |
546 | 546 |
{ |
547 |
String cachedResult = getResultXMLFromCache(query); |
|
547 |
selectionAndExtendedQuery = query +qspec.getReturnDocList()+qspec.getReturnFieldList(); |
|
548 |
String cachedResult = getResultXMLFromCache(selectionAndExtendedQuery); |
|
549 |
logMetacat.debug("The key of query cache is "+selectionAndExtendedQuery); |
|
548 | 550 |
//System.out.println("==========the string from cache is "+cachedResult); |
549 | 551 |
if (cachedResult != null) |
550 | 552 |
{ |
... | ... | |
697 | 699 |
&& pagesize == 9999999 && MetaCatUtil.getOption("query_cache_on").equals("true")) |
698 | 700 |
{ |
699 | 701 |
//System.out.println("the string stored into cache is "+ resultsetBuffer.toString()); |
700 |
storeQueryResultIntoCache(query, resultsetBuffer.toString());
|
|
702 |
storeQueryResultIntoCache(selectionAndExtendedQuery, resultsetBuffer.toString());
|
|
701 | 703 |
} |
702 | 704 |
|
703 | 705 |
return resultsetBuffer; |
... | ... | |
1297 | 1299 |
{ |
1298 | 1300 |
try |
1299 | 1301 |
{ |
1302 |
logMetacat.info("Get query from cache ==="); |
|
1300 | 1303 |
resultSet = (String)queryResultCache.get(query); |
1301 | 1304 |
|
1302 | 1305 |
} |
Also available in: Unified diff
Add return doctype and return field into the key of query cache.