public QueryResults execute() throws QueryCancelledException, RepositoryException {
try {
lock.lock();
if (results == null) {
// this will block and will hold the lock until it is done ...
results = queryEngine.execute(queryContext, command);
}
return results;
} finally {
lock.unlock();
}