Error when using paging and inheritance

Posts   
 
    
TomV
User
Posts: 76
Joined: 31-Jan-2008
# Posted on: 04-Aug-2010 09:22:10   

Hello

We have a resource table which is discriminated (employee, visitor, car) which contains thousands of records and is linked to many other tables as it's the core of our system. Loading the entire object graph for all employees takes about 6 seconds which is too long. I was playing with paging to speed up initial loading of our control, but I run into an error...

I have +/- 24000 records in the resource table (10000 employees, 9000 visitors and 5000 cars). When I load the cars with code below, everything goes ok, and my grid is filled per 1000 cars. But with both visitors and employees the first 1000 records are loaded, and then I receive an error...

In attachment you see the details of the error I receive... When I load all employees without paging, I don't have any problem...



private void LoadDataInBackGround(object o)
      {
         try
         {

            if (Paging)
            {
               IEntity2 en = Activator.CreateInstance(HostControl.MasterType, true) as IEntity2;

               IEntityFields2 fields = new EntityFields2(1);
               fields.DefineField(en.PrimaryKeyFields[0], 0);
            
               int totalRows = Main.DataServer.Adapter.GetDbCount(fields, DefaultFilterPredicate, null, false);
               int pages = (totalRows / 1000) + 1;

               for (int i = 1; i <= pages; i++)
               {
                  EntityCollection<T> entitiesToFetch = CreateEntityCollection();
                  entitiesToFetch.RemovedEntitiesTracker = CreateEntityCollection();
                  Main.DataServer.FetchEntityCollection<T>(Main.Token, entitiesToFetch, PrimaryPrefetchPath, DefaultFilterPredicate, PrimarySorter, i, 1000);

                  if (i == 1)
                     OnDataLoaded(entitiesToFetch);
                  else
                     OnMoreDataLoaded(entitiesToFetch);
               }
            }
            else
            {
               EntityCollection<T> entitiesToFetch = CreateEntityCollection();
               entitiesToFetch.RemovedEntitiesTracker = CreateEntityCollection();
               Main.DataServer.FetchEntityCollection<T>(Main.Token, entitiesToFetch, PrimaryPrefetchPath, DefaultFilterPredicate, PrimarySorter);
               OnDataLoaded(entitiesToFetch);
            }
         }
         catch (EMFetchException ex)
         {
            Main.HandleError(ex, c, "LoadData()");
         }  
      }


Best regards, TomV

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 04-Aug-2010 10:12:47   

Could you please translate the exception message (in the attached pic) into English?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 04-Aug-2010 12:34:03   

Walaa wrote:

Could you please translate the exception message (in the attached pic) into English?

"An error was found in column, parameter or variable #6: type 'Variant' isn't found."

what's the ormsupportclasses build nr you're using and the SQL Server DQE build nr (dll file version -> windows explorer -> right click -> properties -> version tab)

Frans Bouma | Lead developer LLBLGen Pro