66 |
66 |
import edu.ucsb.nceas.metacat.AccessionNumberException;
|
67 |
67 |
import edu.ucsb.nceas.metacat.MetacatResultSet;
|
68 |
68 |
import edu.ucsb.nceas.metacat.MetacatResultSet.Document;
|
|
69 |
import edu.ucsb.nceas.metacat.DBQuery;
|
69 |
70 |
import edu.ucsb.nceas.metacat.DocumentImpl;
|
70 |
71 |
import edu.ucsb.nceas.metacat.EventLog;
|
71 |
72 |
import edu.ucsb.nceas.metacat.IdentifierManager;
|
... | ... | |
571 |
572 |
ObjectList ol = new ObjectList();
|
572 |
573 |
final SessionData sessionData = getSessionData(token);
|
573 |
574 |
int totalAfterQuery = 0;
|
|
575 |
|
574 |
576 |
try
|
575 |
577 |
{
|
|
578 |
if (PropertyService.getProperty("database.queryCacheOn").equals("true"))
|
|
579 |
{
|
|
580 |
//System.out.println("the string stored into cache is "+ resultsetBuffer.toString());
|
|
581 |
DBQuery.clearQueryResultCache();
|
|
582 |
}
|
|
583 |
}
|
|
584 |
catch (PropertyNotFoundException e1)
|
|
585 |
{
|
|
586 |
//just don't do anything
|
|
587 |
}
|
|
588 |
|
|
589 |
try
|
|
590 |
{
|
576 |
591 |
//TODO: Milliseconds need to be added to the dateFormat
|
577 |
592 |
System.out.println("=========== Listing Objects =============");
|
578 |
593 |
System.out.println("Current server time is: " + new Date());
|
... | ... | |
610 |
625 |
MetacatResultSet rs = handler.query(metacatUrl, params, username,
|
611 |
626 |
groups, sessionid);
|
612 |
627 |
List docs = rs.getDocuments();
|
613 |
|
//TODO: make the max count into a const. See ResourceHandler
|
614 |
|
//TODO: does the spec use 1000 as a "return all" flag?
|
615 |
|
if(count == 1000)
|
616 |
|
{
|
617 |
|
count = docs.size();
|
618 |
|
}
|
619 |
628 |
|
620 |
|
//System.out.println("query returned " + docs.size() + " documents.");
|
|
629 |
System.out.println("query returned " + docs.size() + " documents.");
|
621 |
630 |
Vector<Document> docCopy = new Vector<Document>();
|
622 |
631 |
|
623 |
632 |
//preparse the list to remove any that don't match the query params
|
... | ... | |
669 |
678 |
}
|
670 |
679 |
}
|
671 |
680 |
|
672 |
|
/*System.out.println("docid: " + d.docid);
|
|
681 |
/*System.out.println("====================================");
|
|
682 |
System.out.println("doc number " + i);
|
|
683 |
System.out.println("docid: " + d.docid);
|
673 |
684 |
System.out.println("dateSysMetadataModified: " + dateSysMetadataModified);
|
674 |
685 |
System.out.println("startTime: " + startTime);
|
675 |
686 |
System.out.println("endtime: " + endTime);*/
|
fixed bug where the query cache was not getting reset by a REST insert/query combo.