<?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 : Tech Tip: Checkpointing</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Tech Tip: Checkpointing</description>
  <pubDate>Sat, 11 Apr 2026 13:45:55 -700</pubDate>
  <lastBuildDate>Wed, 06 Jun 2007 11:11:33 -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=34</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>Tech Tip: Checkpointing : Level 200 DevForce Express Aug...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=34&amp;PID=94#94</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=21" rel="nofollow">IdeaBlade</a><br /><strong>Subject:</strong> 34<br /><strong>Posted:</strong> 06-Jun-2007 at 11:11am<br /><br /><P =Questi&#111;n style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3><strong><EM>Level 200 <BR>DevForce Express</EM></strong></FONT></P><P =Questi&#111;n style="MARGIN: 0in 0in 0pt"><strong><EM><FONT face="Times New Roman" size=3>Aug 22, 06</FONT></EM></strong></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT face="Times New Roman" size=2>New in DevForce Release 3.2, checkpointing is the local cache equivalent of a database transaction. You set a checkpoint with the new BeginCheckpoint() method of the DevForce PersistenceManager. Call the PM’s RollbackCheckpoint() method if you want to restore the cache to its checkpointed state. Fetches, modifications, merges, deletions, additions, removals – all are reversed!</FONT></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt; LINE-HEIGHT: 14.4pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><FONT size=2><B><SPAN style="COLOR: black; FONT-FAMILY: Verdana; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: Arial">C#:</SPAN></B><SPAN style="FONT-SIZE: 12pt"><?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>MyPersistenceManager.BeginCheckpoint();</strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>&lt;any intervening sequence of operations affecting entities in cache&gt;</strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><strong><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2>MyPersistenceManager.RollbackCheckpoint();</FONT></strong></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt; LINE-HEIGHT: 14.4pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN><FONT size=2><strong>VB.NET:</strong><o:p></o:p></FONT></SPAN></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>MyPersistenceManager.BeginCheckpoint()</strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>&lt;any intervening sequence of operations affecting entities in cache&gt;</strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><strong><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2>MyPersistenceManager.RollbackCheckpoint()</FONT></strong></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT face="Times New Roman" size=2>Checkpointing makes cross-entity undo a snap. It's usually a nasty business to track and undo changes when the user cancels out of a dialog or wizard, especially if there are many different business objects in play. Now we just set a checkpoint when the dialog begins and turn the user loose. If the dialog ends happily, we discard the checkpoint. If the user cancels, we rollback. Either way, it's one call to start and one call to finish. No bookkeeping required.</FONT></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica">We can stack checkpoints with additional BeginCheckpoint() calls. Each subsequent RollbackCheckpoint() undoes the most recent checkpoint. We can cut back the stack by calling RollbackCheckpoint(<I>count</I>) where "<I>count</I>" is the number of checkpoints to rollback. Both overloads return the remaining checkpoint depth.<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica">The RollbackCheckpoints() method rolls all the way back while ClearCheckpoints() wipes the checkpoint slate clean. ClearCheckpoints() is kind of like “commit” in that we are accepting the present state of the entity cache. But take care: our pending changes are still in the cache; they won't become permanent until we save them to the database! <o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica">Note also that the PersistenceManager's Clear() and SaveChanges() methods call ClearCheckpoints() automatically before proceeding with their respective tasks.<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica">Checkpointing is lightweight. A checkpoint session records changes to the cache - not images of the cache. Clearing checkpoints to accept changes is virtually instantaneous; rollbacks, which are comparatively rare, are very fast.<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: 13pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica"><o:p>&nbsp;</o:p></SPAN></P>]]>
   </description>
   <pubDate>Wed, 06 Jun 2007 11:11:33 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=34&amp;PID=94#94</guid>
  </item> 
 </channel>
</rss>