Now when the query is run the query cache is only updated if there are no results. I believe that this is caused by the fact that in ReadAllQuery if the results are empty then following is executed
this.temporaryCachedQueryResults = InvalidObject.instance();
If however there are results they are never cached because in org.eclipse.persistence.internal.descriptors.ObjectBuilder#buildObject
session.isUnitOfWork is true which means the cacheResult method on the query is never called.
So either it's a bug that the empty results are cached or that results are not, I believe the former.
Any help with this would be greatly appreciated.