3 Replies Latest reply on Nov 4, 2012 2:57 PM by pcombellick

    Sporadic behavior when calling AFElement.Add in a loop

    ChewCheeLim

      Hi, I noticed some sporadic behavior when adding AFElement.ADD in a big loop.

       

      If I add 20 or less elements in a loop, Then calling .CheckIn method.. the AF SDK returns quickly.

       

      If I add 40 or more elements in a tight loop, then calling the checkIn method, the AF SDK sometimes goes into a limbo stage..

       

       

       
      code snippet: 
      
      
                          for (int iIndex = 0; iIndex < iBreakerCount; iIndex++)
                          {
                              AFElementTemplate oT = oAfdb.ElementTemplates[ConfigHelper.Instance.GetBreakerTemplateName()];
                              oBreakersFound.Elements.Add(aName[iIndex], oT);
                          }
                          oBreakersFound.CheckIn();
      

       

       

      Anyone has this experience adding a lot of elements in tight loop to comment on this?

       

      Many Thanks