CodeSmith Community
Your Code. Your Way. Faster!

DataRepository.EntityNameProvider.Save stack overflow

Latest post 07-15-2007 12:20 PM by akilhoffer. 3 replies.
  • 04-30-2007 10:38 AM

    • katokay
    • Top 25 Contributor
    • Joined on 07-09-2006
    • Salt Lake City, UT
    • Posts 143
    • Points 3,190

    DataRepository.EntityNameProvider.Save stack overflow

    Save causes a stack overflow exception for the sample provided script. SVN 549.

    Shopper mark = new Shopper();
    mark.DateOfBirth = new DateTime(1977, 8, 27);
    mark.GenderCode = "M";
    mark.UsesTobacco = false;
    mark.IsStudent = false;
    mark.LastModifiedDate = DateTime.Now;
    mark.AssociatedCampaignId = 1;
    Shopper janet = new Shopper();
    janet.DateOfBirth = new DateTime(1980, 10, 28);
    janet.GenderCode = "F";
    janet.UsesTobacco = false;
    janet.IsStudent = false;
    janet.LastModifiedDate = DateTime.Now;
    janet.AssociatedCampaignId = 1;
    Relationship spouse = new Relationship();
    spouse.RelationshipTypeId = (int)RelationshipTypeList.Spouse;
    spouse.RelatedShopperIdSource = janet;
    spouse.RelatedToShopperIdSource = mark;
    mark.RelationshipCollectionGetByRelatedToShopperId.Add(spouse);//comment these two lines to work around stack overflow
    janet.RelationshipCollectionGetByRelatedShopperId.Add(spouse);//
    DataRepository.ShopperProvider.Save(mark);
    DataRepository.ShopperProvider.Save(janet);
    spouse.RelatedToShopperId = mark.ShopperId;
    spouse.RelatedShopperId = janet.ShopperId;
    DataRepository.RelationshipProvider.Save(spouse);

     

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.ShopperBase.Copy() Line 901 + 0x19 bytes         C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.ShopperBase.Clone() Line 928 + 0xa bytes          C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.RelationshipBase.MakeCopyOf(object x = {ExtendHealth.Entities.Shopper}) Line 552 + 0x14 bytes C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.RelationshipBase.Copy() Line 523 + 0x17 bytes  C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.RelationshipBase.Clone() Line 538 + 0xa bytes   C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.ListBase<ExtendHealth.Entities.Relationship>.MakeCopyOf(object x = {ExtendHealth.Entities.Relationship}) Line 580 + 0x14 bytes  C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.TList<ExtendHealth.Entities.Relationship>.Copy() Line 125 + 0x39 bytes     C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.TList<ExtendHealth.Entities.Relationship>.Clone() Line 113 + 0xa bytes     C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.ShopperBase.MakeCopyOf(object x = Count = Cannot evaluate expression because the current thread is in a stack overflow state.) Line 942 + 0x14 bytes            C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.ShopperBase.Copy() Line 914 + 0x21 bytes         C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.ShopperBase.Clone() Line 928 + 0xa bytes          C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.RelationshipBase.MakeCopyOf(object x = {ExtendHealth.Entities.Shopper}) Line 552 + 0x14 bytes C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.RelationshipBase.Copy() Line 523 + 0x17 bytes  C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.RelationshipBase.Clone() Line 538 + 0xa bytes   C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.ListBase<ExtendHealth.Entities.Relationship>.MakeCopyOf(object x = {ExtendHealth.Entities.Relationship}) Line 580 + 0x14 bytes  C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.TList<ExtendHealth.Entities.Relationship>.Copy() Line 125 + 0x39 bytes     C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.TList<ExtendHealth.Entities.Relationship>.Clone() Line 113 + 0xa bytes     C#

                    ExtendHealth.Entities.dll!ExtendHealth.Entities.ShopperBase.MakeCopyOf(object x = Count = Cannot evaluate expression because the current thread is in a stack overflow state.) Line 942 + 0x14 bytes            C#

     

    Filed under:
    • Post Points: 35
  • 05-04-2007 9:01 AM In reply to

    • hrncir
    • Not Ranked
    • Joined on 03-29-2007
    • Prague
    • Posts 7
    • Points 155

    Re: DataRepository.EntityNameProvider.Save stack overflow

    This is because of BUG in Copy method in Entities\EntityInstanceBase.generated.cst on line 556. There is a piece of code generation copy for Source properties. These may, as offen do, point to objects joined with the object pointing to them and thus the code results to closed loop and stack overflow.

    I suggest not to call this piece of code and replace "if (IncludeRelations){ " on line 556 with "if (false){" temporarily until anybody of netTiers team fix it.

    Marek Hrncir 

    • Post Points: 35
  • 05-07-2007 8:59 AM In reply to

    • katokay
    • Top 25 Contributor
    • Joined on 07-09-2006
    • Salt Lake City, UT
    • Posts 143
    • Points 3,190

    Re: DataRepository.EntityNameProvider.Save stack overflow

    Thanks for the help. That will get us by for now.
    • Post Points: 35
  • 07-15-2007 12:20 PM In reply to

    Re: DataRepository.EntityNameProvider.Save stack overflow

     Has anyone seen a real fix for this yet? I'm having the same problem when doing EntityProvider.Update. I need to deploy in a few days, and everything is broken until I can get this resolved. Thanks in advance for your input!

    • Post Points: 5
Page 1 of 1 (4 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems