First I will explain what I am trying to do.
I have DevForce Silverlight application. I am using Remote Server
Method (RSM/RPC) to execute a set of queries to data base at server side.
Server method returns EntityCacheState to
client. I merge the entity manager cache received from server with client side
entity manager cache. I verify the number of entities I have in client side
cache, it is same as server cache and same as what is there is database.
Everything is fine till now.
Now I execute the same query at client side (query that was
earlier executed at server side), but with query strategyQueryStrategy.CacheOnly.
This is the query at server side
entityManager.GetQuery<MetadataRule>()
.AddIncludePaths(new string[] { "BaseEntity", "MetadataRuleConditions.BaseEntity","MetadataRuleConditions.MetadataCondition.BaseEntity" })
.ExecuteAsync()
This
is the query at client side.
entityManager.MetadataRules
.AddIncludePaths(new string[] { "BaseEntity", "MetadataRuleConditions.BaseEntity","MetadataRuleConditions.MetadataCondition.BaseEntity" })
.With(QueryStrategy.CacheOnly)
.ExecuteAsync()
Include
paths specified are valid.
I
executed the following test at client side after the server cache is merged
with client cache
entityManager.MetadataRules
.AddIncludePaths(new string[] { "BaseEntity", "MetadataRuleConditions.BaseEntity","MetadataRuleConditions.MetadataCondition.BaseEntity" })
.With(QueryStrategy.CacheOnly)
.ExecuteAsync(res
=>
{
var metaDataRules = res.Results.Cast<MetadataRule>().ToList();
foreach (var rule in metaDataRules)
{
if (rule.MetadataRuleConditions.IsPendingEntityList)
{
throw new Exception("Conditions
loading is pending in cache");
}
}
});
This
throw exception. For one of the MetadataRule, property is MetadataRuleConditions.IsPendingEntityList true. Which
means related entity MetadataRuleConditions is not loaded. I
verified in the data base for the number of rows for this navigation. The count
is zero, which is correct.
The
same validation is successful at server side.
If
I verify client cache, all the entities present at client cache, no entities
are missing. Ideally the property MetadataRuleConditions.IsPendingEntityList should
return false, but this is not the case here.
What
is the issue here??
Is
there a work around for this??