New Posts New Posts RSS Feed: EntityQuery with Top and OrderBy removes other entity from cache?!
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

EntityQuery with Top and OrderBy removes other entity from cache?!

 Post Reply Post Reply
Author
Ficht-Man View Drop Down
Newbie
Newbie


Joined: 20-Aug-2010
Posts: 1
Post Options Post Options   Quote Ficht-Man Quote  Post ReplyReply Direct Link To This Post Topic: EntityQuery with Top and OrderBy removes other entity from cache?!
    Posted: 20-Aug-2010 at 7:07am
Hello everybody,

recently i had a strange problem with "TOP queries", PersistenceManager-Cache and SortOrder...

It took a while till i found a way to reproduce the following:

In my winform-application i have a 2 gridview showing some Employee-Entities and a "LoadData"-Button for each of them

Button 1:

var q = new EntityQuery(typeof(Employee));
q.Top = 20;
q.AddClause(Employee.FirstNameEntityColumn, EntityQueryOp.NE, "Abc");
q.AddOrderBy(Employee.FirstNameEntityColumn, ListSortDirection.Ascending);

Button 2:

var q = new EntityQuery(typeof(Employee));
q.Top = 1;
q.AddClause(Employee.FirstNameEntityColumn, EntityQueryOp.NE, "Abc");


I used the default PM for both queries..

After pressing button 1 some entities appear in GridView 1.
After pressing button 2 one entity appears in GridView 2 BUT ANOTHER ENTITY DISAPEARS out of GridView 1?!

AS you see above, the query for button 2 has no sort criteria.
To reproduce this problem i had to change the PK column in dhe entity-mapper from ID to another column. AS long as the ID-Column was defined as PK it worked.

Please let me know if there is a reason for this that i do not see..

Best Regards

P.S.: i think the problem is, where the persistencemanager merges the refetched data with the cached data.
do have any cache-data-obsoletion-detection mechanism that kicks out the wrong record for some reason?
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 20-Aug-2010 at 4:38pm
Can you send an email to IdeaBladeSupportTrack at ideablade dot com with the same subject line?
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down