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?
|