Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andy 9 posts 30 karma points
    Apr 23, 2015 @ 08:33
    Andy
    0

    Intermittent LINQ Collection was modified Exception

    Hi,

    I’m having an issue with Tea Commerce. Basically, it is causing (intermittent) LINQ errors:

    Exception: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.

       at System.Collections.Generic.List`1.Enumerator.MoveNextRare()

       at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)

       at TeaCommerce.Api.Services.OrderService.Get(Int64 storeId, Guid orderId)

       at TeaCommerce.Api.Web.TeaCommerceHelper.GetCurrentOrder(Int64 storeId, Boolean autoCreate)

       at TeaCommerce.Api.Web.TeaCommerceHelper.GetPrice(Int64 storeId, String productIdentifier)

       at ASP._Page_macroScripts_catalogue_product_page_cshtml.Execute() in xxxxxxx\MacroScripts\catalogue\product-page.cshtml:line 507

       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()

       at System.Web.WebPages.WebPage.ExecutePageHierarchy()

       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)

       at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)

       at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)

       at umbraco.macro.loadMacroScript(MacroModel macro)

       at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)

     

    I note that an older Tea Commerce version had a fix for this issue (v1.4.1.0), though we are using v 2.2.3 on Umbraco v6.2.4.

    This seems to occur randomly, and results in macro script engine errors being presented to users. I understand the nature of the error but not what could possibly be causing this collection modification?? 

    Is this a bug or is there some other logical explanation for this that we can fix?

    Cheers,
    Andy

  • Anders Burla 2560 posts 8256 karma points
    Apr 23, 2015 @ 08:49
    Anders Burla
    0

    In 2.3.3 we fixed so services now use locks and this bug is fixed. So upgrade - note the breaking changes.

    Kind regards
    Anders

Please Sign in or register to post replies

Write your reply to:

Draft