<?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 : No entities saved to DB despite successful SaveAync</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : No entities saved to DB despite successful SaveAync</description>
  <pubDate>Thu, 21 May 2026 18:21:30 -700</pubDate>
  <lastBuildDate>Fri, 09 Apr 2010 07:34:03 -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=1533</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>No entities saved to DB despite successful SaveAync : Ha, yeah, that&amp;#039;s sort of...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1533&amp;PID=6464#6464</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=662" rel="nofollow">dpollot44</a><br /><strong>Subject:</strong> 1533<br /><strong>Posted:</strong> 09-Apr-2010 at 7:34am<br /><br />Ha, yeah, that's sort of how I felt.&nbsp; I certainly wasn't expecting AcceptChanges to push the changes to the database, but I definitely expected that AcceptChanges would push the most recent change set back to the context, and that the context would be smart enough to know that regardless of the current edit scope, the object was dirty and therefore push all of the "accepted" changed back to the database when SaveChanges() was called.&nbsp; I thought that was fairly standard practice, hence my business object method below (with some of the more colorful comments removed).<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /// Pushes changes to this object (and related objects) back to the context<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /// and sets the object back to an unmodified state.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /// &lt;/summary&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public void AcceptChanges()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // For now these two lines are commented out because AcceptChanges(), well, sorta does exactly the opposite of<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // what the name implies, i.e., these changes will NEVER make it back to the database.<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // EntityAspect.AcceptChanges();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // GetRelatedObjectGraph().Where(e =&gt; e.EntityAspect.HasChanges()).ForEach(so =&gt; so.EntityAspect.AcceptChanges());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IsModified = false;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IsLocked = true;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (null != ChangesAccepted) ChangesAccepted(this, new EventArgs());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>]]>
   </description>
   <pubDate>Fri, 09 Apr 2010 07:34:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1533&amp;PID=6464#6464</guid>
  </item> 
  <item>
   <title>No entities saved to DB despite successful SaveAync : It really is a good point...anyone...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1533&amp;PID=6463#6463</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=615" rel="nofollow">RyanBritton</a><br /><strong>Subject:</strong> 1533<br /><strong>Posted:</strong> 09-Apr-2010 at 7:04am<br /><br />It really is a good point...anyone with any level of understanding when it comes to transactional database best practices stands a good chance of making the assumption that this is the Method which commits the transaction prior to engaging the actual data objects to perform the save.<DIV></DIV><DIV>&nbsp;</DIV><DIV>A rename to "EraseAllTracesOfDataActivityAndEnterNinjaStealthMode" might be more appropriate...</DIV>]]>
   </description>
   <pubDate>Fri, 09 Apr 2010 07:04:34 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1533&amp;PID=6463#6463</guid>
  </item> 
  <item>
   <title>No entities saved to DB despite successful SaveAync : I&amp;#039;m running into a similar...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1533&amp;PID=6462#6462</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=662" rel="nofollow">dpollot44</a><br /><strong>Subject:</strong> 1533<br /><strong>Posted:</strong> 09-Apr-2010 at 6:50am<br /><br />I'm running into a similar situation described below:<br>We're in the midst of prototyping your framework which includes code genning our own entities deriving from our own business objects, which in turn derive from your entity classes (same with the entity manager).&nbsp; Within our API, the business object has an AcceptChanges() method which calls the base class's EntityAspect.AcceptChanges().&nbsp; After learning that this sets the entity state back to unchanged and thereby removes it from being saved to the database, I'm left wondering why your API even includes this method?&nbsp; What are the use cases for a method called AcceptChanges() that, when called, tells the EntityManager NOT to save the changes I thought I was accepting to the database??<br>]]>
   </description>
   <pubDate>Fri, 09 Apr 2010 06:50:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1533&amp;PID=6462#6462</guid>
  </item> 
  <item>
   <title>No entities saved to DB despite successful SaveAync : I notice below that you say that...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1533&amp;PID=5741#5741</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=23" rel="nofollow">davidklitzke</a><br /><strong>Subject:</strong> 1533<br /><strong>Posted:</strong> 04-Nov-2009 at 2:19pm<br /><br /><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I notice below that you say that “I've ensured that I call AcceptChanges beforehand”. &nbsp;&nbsp;Don’t do that!&nbsp; AcceptChanges will change the&nbsp;EntityState of the Entity to “Unchanged”. &nbsp;Then when you call “SaveChanges”, it will not save the Entity to the datababase because it’s EntityState is Unchanged. &nbsp;SaveChanges will only save an Entity if its state is Added, Modified, or Deleted.<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The other advice that I have is to look at a successful example. &nbsp;There is a Silverlight example in the Learning Resources under Business Object Persistence under Adding and Deleting.<o:p></o:p></SPAN></FONT></P><P =Ms&#111;normal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>]]>
   </description>
   <pubDate>Wed, 04 Nov 2009 14:19:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1533&amp;PID=5741#5741</guid>
  </item> 
  <item>
   <title>No entities saved to DB despite successful SaveAync : Hi guys,I really hope someone...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1533&amp;PID=5693#5693</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=615" rel="nofollow">RyanBritton</a><br /><strong>Subject:</strong> 1533<br /><strong>Posted:</strong> 28-Oct-2009 at 3:16am<br /><br />Hi guys,<br><br>I really hope someone can help urgently - I am working on a Silverlight application and I have a very frustrating issue. On any of my forms, after I edit an entity in the silverlight dataform and save the results I recieve an ok=true result in the return arguments from SaveChangesAsync but no data is saved to the database. I have tried passing the entities to save to the SaveChangesAsync method, changing the query strategy (I thought it might have something to do with the cache), calling SaveChanges off the EntityManager in the entity in question's EntityAspect property. I've tried a single entity and multiple entities and I've ensured that I call AcceptChanges beforehand. If I enable query logging and review the log I can see that there are successful "Fetch" queries being executed against the database but there isn't even an attempt to save to the SQL server.<br><br>aaaaaarrrrgggghhhhh!<br><br>Please can someone with more experience assist? The one thing that I noticed is that the SaveOperation value in the results says "No Operation", but I am not sure what that means and if it is relevant.<br><br>Your assistance in this regard is greatly appreciated.<br><br>Ryan<br>]]>
   </description>
   <pubDate>Wed, 28 Oct 2009 03:16:52 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1533&amp;PID=5693#5693</guid>
  </item> 
 </channel>
</rss>