<?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: Supporting Disconnected Applications</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Tech Tip: Supporting Disconnected Applications</description>
  <pubDate>Fri, 12 Jun 2026 10:01:23 -700</pubDate>
  <lastBuildDate>Wed, 06 Jun 2007 15:45:32 -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=67</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: Supporting Disconnected Applications : Level 200 DevForce Enterprise June...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=67&amp;PID=140#140</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> 67<br /><strong>Posted:</strong> 06-Jun-2007 at 3:45pm<br /><br /><P =Questi&#111;n style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3><strong><EM>Level 200 <BR>DevForce Enterprise</EM></strong></FONT></P><P =Questi&#111;n style="MARGIN: 0in 0in 0pt"><strong><EM><FONT face="Times New Roman" size=3>June 30, 2006</FONT></EM></strong></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT face="Times New Roman" size=2>With vacations upon us, we felt you might find this Tech Tip especially useful.</FONT></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT face="Times New Roman" size=2>Many applications enable end users to work on data while offline. Users of Microsoft Outlook, for example, can review and create new emails while on a plane or in some other disconnected location. Changes can be saved back to the host database when the connection is restored. </FONT></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT face="Times New Roman" size=2>Of course we can only work disconnected with data that have been stored locally. The application must anticipate the user's disconnected data needs and provide mechanisms to transition between online and offline operation.</FONT></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT size=2><FONT face="Times New Roman">DevForce can help you build such applications. The DevForce </FONT><SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'">PersistenceManager’s</SPAN><FONT face="Times New Roman"> “EntitySet” methods, for example, shuttle business object data between the manager’s in-memory entity cache and local storage.</FONT></FONT></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT size=2><FONT face="Times New Roman">The </FONT><SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'">SaveEntitySet</SPAN><FONT face="Times New Roman"> methods convert object state to “</FONT><SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'">EntitySet</SPAN><FONT face="Times New Roman">” format.</FONT></FONT></P><P =Ms&#111;normal style="MARGIN: 5pt 0in; LINE-HEIGHT: 13pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica">&nbsp;<SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><B>C#:</P><DIV></DIV><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT color=#808080><FONT style=": #e6e6e6"><FONT face="Courier New">void SaveEntitySet(String pFileName);<BR>void SaveEntitySet(IEnumerable pDataRows, String pFileName);<BR>void SaveEntitySet(Stream pStream, bool pCloseOnExit);<BR>void SaveEntitySet(IEnumerable pDataRows, Stream pStream,<BR>&nbsp; bool pCloseOnExit);</FONT><SPAN style="FONT-FAMILY: Helvetica"> </P><DIV></DIV><P =Ms&#111;normal style="MARGIN: 5pt 0in; LINE-HEIGHT: 13pt"><B><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica"><BR><FONT color=#000000>VB.NET:</FONT></SPAN></B><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica"><?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><o:p></o:p></SPAN></FONT></FONT></FONT></B><o:p><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT size=2><SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'">SaveEntitySet</SPAN><FONT face="Times New Roman"> can preserve the entire entity cache or just some selected objects. The destination file may reside anywhere in the local file system although it is often wise to save to the user's "Isolated Storage". The "stream" signatures facilitate piping the data through intermediate filters before they get to their ultimate destination. For example, we might want to flow object data through an encryption filter before storing them. We can also append custom bytes to the same stream if you're up to managing that yourself.</FONT></FONT></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT size=2><FONT face="Times New Roman">When the user re-launches the application, it should locate the saved file (or stream) and restore its contents to the </FONT><SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'">PersistenceManager’s</SPAN><FONT face="Times New Roman"> entity cache, using one of the following methods.</FONT></FONT></P><P =Ms&#111;normal style="MARGIN: 5pt 0in; LINE-HEIGHT: 13pt"><SPAN><BR><strong>C#:</strong></P><DIV></DIV><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT color=#808080><FONT style=": #e6e6e6"><strong><FONT face="Courier New">void RestoreEntitySet(String pFileName);<BR>void RestoreEntitySet(String pFileName, RestoreStrategy pStrategy);<BR>void RestoreEntitySet(Stream pStream, RestoreStrategy pStrategy,<BR>&nbsp;&nbsp;bool pCloseOnExit);</FONT><SPAN style="FONT-FAMILY: Helvetica"> <o:p></o:p></SPAN></strong></FONT></FONT></FONT></P><P =Ms&#111;normal style="MARGIN: 5pt 0in; LINE-HEIGHT: 13pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN-US; mso-fareast-: EN-US; mso-bidi-: AR-SA"><BR style="mso-special-character: line-break"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN-US; mso-fareast-: EN-US; mso-bidi-: AR-SA"><strong>VB.NET:</strong></P><DIV></SPAN><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT size=2><FONT color=#808080><FONT style=": #e6e6e6"><FONT face="Courier New"><strong>Sub RestoreEntitySet(pFileName as String)<BR>Sub RestoreEntitySet(pFileName as String, pStrategy as RestoreStrategy)<BR>Sub RestoreEntitySet(pStream as Stream, pStrategy as RestoreStrategy, _<BR>&nbsp;&nbsp;pCloseOnExit as Boolean)<SPAN style="FONT-FAMILY: Helvetica"><o:p></o:p></SPAN></strong></FONT></FONT></FONT></FONT></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT size=2><FONT face="Times New Roman">The </FONT><SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'">RestoreStrategy</SPAN><FONT face="Times New Roman"> parameter prescribes how to handle entity set objects that already exist in the target </FONT><SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'">PersistenceManager’s</SPAN><FONT face="Times New Roman"> cache. The default </FONT><SPAN style="COLOR: blue; FONT-FAMILY: 'Courier New'">RestoreStrategy</SPAN><FONT face="Times New Roman"> preserves the cache's pending business objects changes – additions, modifications, and deletions.</FONT></FONT></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT face="Times New Roman" size=2>When the application obtains a server connection, it can synchronize local objects with the remote data source. It can save local pending changes, relying upon DevForce optimistic concurrency checking to prevent overwriting other users’ changes. It might refresh local copies of business objects with objects updated by other users previously.</FONT></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT face="Times New Roman" size=2>Remember: the application must pre-fill the cache with entities the user will need offline before saving the cache and disconnecting. While disconnected, queries and object navigation can only access cached entities.</FONT></P><BR style="mso-special-character: line-break"></SPAN><o:p></o:p></SPAN></DIV></o:p></SPAN>]]>
   </description>
   <pubDate>Wed, 06 Jun 2007 15:45:32 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=67&amp;PID=140#140</guid>
  </item> 
 </channel>
</rss>