Print Page | Close Window

MySQL view - entity mgr does not cache all recs

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1650
Printed Date: 21-Sep-2025 at 2:12am


Topic: MySQL view - entity mgr does not cache all recs
Posted By: mlashley
Subject: MySQL view - entity mgr does not cache all recs
Date Posted: 18-Feb-2010 at 8:30am

I'm using this code to pull all the records from a MySQL db using a view:

var _mgr1 = new DomainModelEntityManager();

_mgr1.ExecuteQueryAsync(_mgr.vcompletedsurveydata

.Where(item => item.Created >= date)),

(fetchArgs) => { SetCasesSoldChartDataSource(fetchArgs.Result); }

, null);

For some reason this Linq query doesn't bring back all the records in the view.  I verified that the SQL sent to the db is correct and it does pull return all the records when run in a SQL query browser.  A lot of records are returned to the cache, but quite a few are missing.  Changing the Linq to the snip below brings the missing records into the cache:

var _mgr1 = new DomainModelEntityManager();

_mgr1.ExecuteQueryAsync(_mgr.vcompletedsurveydata

.Where(item => item.Created >= date)

.Where(item => item.SurveyQuestion.Contains("cases sold")),

(fetchArgs) => { SetCasesSoldChartDataSource(fetchArgs.Result); }

, null);

 
Any suggestions or help on what I may be doing wrong?
 
- Matt



Replies:
Posted By: GregD
Date Posted: 19-Feb-2010 at 2:00pm
Not sure, but check to see that the primary key is defined correctly for the target item.


Posted By: mlashley
Date Posted: 24-Feb-2010 at 8:43am
Ah - so the primary key plays an important part in DevForce's cache mechanism.  That makes sense.  The view I'm using flattens a set of data and the same primary key is returned multiple times for different recs.  This probably explains why the records with the latest timestamps are the recs I see in the cache.
 
Here's a shot in the dark - is there any way to define a composite key for DevForce to use in its cache?  I don't think MySQL provides any way for me to do this in the view so it'd need to be something done on the DevForce side.



Print Page | Close Window