New Posts New Posts RSS Feed: Data Caching
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Data Caching

 Post Reply Post Reply
Author
danielp37 View Drop Down
Newbie
Newbie


Joined: 18-Mar-2008
Location: United States
Posts: 29
Post Options Post Options   Quote danielp37 Quote  Post ReplyReply Direct Link To This Post Topic: Data Caching
    Posted: 27-Mar-2008 at 10:02pm
I have a query like this:
 

var member = dataset.ExecuteQueryForEntity<Member>((from mem in dataset.Members

    where mem.MemberId == "754402"

    select mem));

 
and then I iterate through the Member's ActualCoverages collection and access the ActualCoverage's CoverageIntent link (CoverageIntent is a table that ActualCoverage links to).  For Example:

foreach(var ac in member.ActualCoverages)

{

    if(!ac.CoverageIntent.IsNullEntity)

    {

         if(!ac.CoverageIntent.Employer.IsNullEntity)

              Console.WriteLine(ac.CoverageIntent.Employer.EmployerName);

    }

}

 
Several of the ActualCoverages link to the same CoverageIntent (3478c) and I was expecting that the first time that the CoverageIntent is accessed, it would need to go to the DB, but then subsequent requests would get it from the cache because even though we are accessing the CoverageIntent from different ActualCoverages, it is the same coverageintent and should already be in the local cache.
 
Am I doing something wrong?  I can see in the Trace Viewer that the same query is getting called over and over trying to get the same CoverageIntent.
 
Thanks,
 
Dan
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 08-Apr-2008 at 11:38am
Sorry for the late reply.
 
No, you're not doing anything wrong.  It looks like we've got a bug in our handling of relational properties.  In this case, since we've seen the EntityKey for CoverageIntent before, it should be in the QueryCache and we should therefore look in the EntityCache for the entity, and not go to the database. 
 
Thanks for pointing this out.  I've opened a bug report for this issue.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down