// First get the expired contracts that have not been archived yet
// Get the prices and archive them
query = "SELECT FROM " + Contract.class.getName() + " WHERE expiryDate>0 && archived==false ORDER BY expiryDate";
print(query);
PersistenceManager pm = PMF.get().getPersistenceManager();
Query q = pm.newQuery(query);
Queue queue = QueueFactory.getDefaultQueue();
@SuppressWarnings("unchecked")
List<Contract> results = (List<Contract>) q.execute();
print("Putting in queue for processing " + results.size() + " contracts.");
for (Contract c : results) {