New Posts New Posts RSS Feed: MySQL view - entity mgr does not cache all recs
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

MySQL view - entity mgr does not cache all recs

 Post Reply Post Reply
Author
mlashley View Drop Down
Newbie
Newbie


Joined: 18-Feb-2010
Location: Idaho
Posts: 3
Post Options Post Options   Quote mlashley Quote  Post ReplyReply Direct Link To This Post Topic: MySQL view - entity mgr does not cache all recs
    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.
Back to Top
GregD View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 374
Post Options Post Options   Quote GregD Quote  Post ReplyReply Direct Link To This Post Posted: 19-Feb-2010 at 2:00pm
Not sure, but check to see that the primary key is defined correctly for the target item.
Back to Top
mlashley View Drop Down
Newbie
Newbie


Joined: 18-Feb-2010
Location: Idaho
Posts: 3
Post Options Post Options   Quote mlashley Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down