<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Stack Overflow Exception</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Stack Overflow Exception</description>
  <pubDate>Tue, 12 May 2026 22:16:04 -700</pubDate>
  <lastBuildDate>Wed, 13 Nov 2013 14:30:43 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=4601</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Stack Overflow Exception : The error is occurring when cloning...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4601&amp;PID=17232#17232</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 4601<br /><strong>Posted:</strong> 13-Nov-2013 at 2:30pm<br /><br />The error is occurring when cloning your entities with the DataContractSerializer prior to the actual save to the database.&nbsp; You might be able to work around the stack overflow by changing the "SerializationContextMode" to Alternate, as described here: <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/Serializati&#111;nC&#111;ntext" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/SerializationContext</A>.<DIV sab="944">&nbsp;</DIV><DIV sab="945">To deal with the chunking issue, the FindEntityGraph method on the EntityManager can help determine subsets of related entities.</DIV><DIV sab="946">&nbsp;</DIV><DIV sab="947">Also, in the 6.1.15 release we changed how cloning is performed so that it no longer uses the DCS by default.&nbsp;&nbsp; I don't know whether this would help with the stack overflow, but it might also be an option.</DIV><DIV sab="948">&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 13 Nov 2013 14:30:43 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4601&amp;PID=17232#17232</guid>
  </item> 
  <item>
   <title>Stack Overflow Exception : I call SaveChanges with a large...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4601&amp;PID=17231#17231</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=2662" rel="nofollow">cm</a><br /><strong>Subject:</strong> 4601<br /><strong>Posted:</strong> 13-Nov-2013 at 11:05am<br /><br />I call SaveChanges with a large number (tens of thousands) of changed entities. I get a stack overflow exception as shown in call stack below. In the past, other developers have worked around this problem by "chunking" the save but I was having problems when adding the entities to the manager with exceptions when adding entities with foreign keys to an entity saved several chunks previous. Thoughts anyone? Is there a documented limit on the number of entities that can be saved at one time?<br><br>&nbsp;&nbsp;&nbsp;&nbsp; &#091;Managed to Native Transition&#093;&nbsp;&nbsp;&nbsp; <br>&gt;&nbsp;&nbsp;&nbsp; mscorlib.dll!System.RuntimeType.GetGenericTypeDefinition() + 0x8f bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.CollectionDataContract.IsCollectionInterface(System.Type type) + 0x69 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(System.Runtime.Serialization.XmlWriterDelegator xmlWriter, object obj, System.RuntimeTypeHandle objectTypeHandle, System.Type objectType, int declaredTypeID, System.RuntimeTypeHandle declaredTypeHandle, System.Type declaredType) + 0x62 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(System.Runtime.Serialization.XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, System.RuntimeTypeHandle declaredTypeHandle) + 0x1a7 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference(System.Runtime.Serialization.XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, System.RuntimeTypeHandle declaredTypeHandle) + 0x6f bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; &#091;Lightweight Function&#093;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.ClassDataContract.WriteXmlValue(System.Runtime.Serialization.XmlWriterDelegator xmlWriter, object obj, System.Runtime.Serialization.XmlObjectSerializerWriteContext context) + 0x31 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(System.Runtime.Serialization.XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, System.RuntimeTypeHandle declaredTypeHandle) + 0x6d bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference(System.Runtime.Serialization.XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, System.RuntimeTypeHandle declaredTypeHandle) + 0x6f bytes&nbsp;&nbsp;&nbsp; <br><br>... ... continues the same until:<br><br>&nbsp;&nbsp;&nbsp;&nbsp; &#091;Lightweight Function&#093;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.ClassDataContract.WriteXmlValue(System.Runtime.Serialization.XmlWriterDelegator xmlWriter, object obj, System.Runtime.Serialization.XmlObjectSerializerWriteContext context) + 0x31 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(System.Runtime.Serialization.DataContract dataContract, System.Runtime.Serialization.XmlWriterDelegator xmlWriter, object obj, bool verifyKnownType, System.RuntimeTypeHandle declaredTypeHandle, System.Type declaredType) + 0xeb bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(System.Runtime.Serialization.XmlWriterDelegator xmlWriter, object obj, System.RuntimeTypeHandle objectTypeHandle, System.Type objectType, int declaredTypeID, System.RuntimeTypeHandle declaredTypeHandle, System.Type declaredType) + 0x2c6 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(System.Runtime.Serialization.XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, System.RuntimeTypeHandle declaredTypeHandle) + 0x1a7 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference(System.Runtime.Serialization.XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, System.RuntimeTypeHandle declaredTypeHandle) + 0x6f bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; &#091;Lightweight Function&#093;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(System.Runtime.Serialization.XmlWriterDelegator xmlWriter, object obj, System.Runtime.Serialization.XmlObjectSerializerWriteContext context) + 0x41 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(System.Runtime.Serialization.XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, System.RuntimeTypeHandle declaredTypeHandle) + 0x6d bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference(System.Runtime.Serialization.XmlWriterDelegator xmlWriter, object obj, bool isDeclaredType, bool writeXsiType, int declaredTypeID, System.RuntimeTypeHandle declaredTypeHandle) + 0x6f bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; &#091;Lightweight Function&#093;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.ClassDataContract.WriteXmlValue(System.Runtime.Serialization.XmlWriterDelegator xmlWriter, object obj, System.Runtime.Serialization.XmlObjectSerializerWriteContext context) + 0x31 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(System.Runtime.Serialization.XmlWriterDelegator writer, object graph, System.Runtime.Serialization.DataContractResolver dataContractResolver) + 0x11c bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializer.WriteObjectContentHandleExceptions(System.Runtime.Serialization.XmlWriterDelegator writer, object graph) + 0x3e2 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; IdeaBlade.EntityModel.dll!IdeaBlade.EntityModel.SerializationFns.SaveDCS(object instance, System.IO.Stream stream, bool closeOnExit, System.Collections.Generic.IEnumerable&lt;System.Type&gt; knownTypes, bool useBinaryFormat) + 0x1c7 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; IdeaBlade.EntityModel.dll!IdeaBlade.EntityModel.SerializationFns.Save(object instance, System.IO.Stream stream, bool closeOnExit, System.Collections.Generic.IEnumerable&lt;System.Type&gt; knownTypes, bool useBinary) + 0x62 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; IdeaBlade.EntityModel.dll!IdeaBlade.EntityModel.SaveWorkState.DeepClone() + 0x86 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; IdeaBlade.EntityModel.Server.dll!IdeaBlade.EntityModel.Server.EntityServer.SaveChanges(IdeaBlade.EntityModel.SaveWorkState workState) + 0x78 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; IdeaBlade.EntityModel.dll!IdeaBlade.EntityModel.EntityServerProxy.SaveChanges.AnonymousMethod__10() + 0x95 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; IdeaBlade.EntityModel.dll!IdeaBlade.EntityModel.EntityServerProxy.ExecFunc&lt;IdeaBlade.EntityModel.SaveWorkState&gt;(System.Func&lt;IdeaBlade.EntityModel.SaveWorkState&gt; func, bool funcWillHandleException) + 0x6c bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; IdeaBlade.EntityModel.dll!IdeaBlade.EntityModel.EntityServerProxy.ExecuteOnServer&lt;IdeaBlade.EntityModel.SaveWorkState&gt;(System.Func&lt;IdeaBlade.EntityModel.SaveWorkState&gt; func, bool funcWillHandleException) + 0x1f4 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; IdeaBlade.EntityModel.dll!IdeaBlade.EntityModel.EntityServerProxy.SaveChanges(IdeaBlade.EntityModel.SaveWorkState workState) + 0xe2 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; IdeaBlade.EntityModel.dll!IdeaBlade.EntityModel.EntityManager.SaveEntitiesCore(IdeaBlade.EntityModel.SaveWorkState workState) + 0xe6 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; IdeaBlade.EntityModel.dll!IdeaBlade.EntityModel.EntityManager.SaveChangesAsyncCore.AnonymousMethod__aa(IdeaBlade.EntityModel.EntitySaveOperation op) + 0x111 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; IdeaBlade.EntityModel.dll!IdeaBlade.EntityModel.AsyncProcessor&lt;IdeaBlade.EntityModel.EntitySaveOperation&gt;.Execute.AnonymousMethod__4(object o) + 0xee bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0x285 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0x9 bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; mscorlib.dll!System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() + 0x6f bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() + 0x1ea bytes&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; &#091;Native to Managed Transition&#093;&nbsp;&nbsp;&nbsp; <br><br>]]>
   </description>
   <pubDate>Wed, 13 Nov 2013 11:05:11 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4601&amp;PID=17231#17231</guid>
  </item> 
 </channel>
</rss>