<?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 : Get only changed entities from the database</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Get only changed entities from the database</description>
  <pubDate>Tue, 14 Apr 2026 23:20:15 -700</pubDate>
  <lastBuildDate>Sun, 09 Dec 2007 19:31:42 -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=598</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>Get only changed entities from the database : Thankd David... I will take this...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=598&amp;PID=2149#2149</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=110" rel="nofollow">sieepvvalk</a><br /><strong>Subject:</strong> 598<br /><strong>Posted:</strong> 09-Dec-2007 at 7:31pm<br /><br />Thankd David... I will take this into consideration.]]>
   </description>
   <pubDate>Sun, 09 Dec 2007 19:31:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=598&amp;PID=2149#2149</guid>
  </item> 
  <item>
   <title>Get only changed entities from the database : Option 2 is better than Option...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=598&amp;PID=2148#2148</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> 598<br /><strong>Posted:</strong> 09-Dec-2007 at 5:38pm<br /><br /><DIV>&nbsp;Option 2 is better than Option 3 because:</DIV><DIV>&nbsp;</DIV><DIV>(1) Option 2 takes less time for the database to execute (one time comparison versus one time comparison plus one NOT IN comparison.</DIV><DIV>&nbsp;</DIV><DIV>(2) Option 2 takes less processing time on the client to formulate.</DIV><DIV>&nbsp;</DIV><DIV>As the number of items in the entity cache gets larger and larger, Option 2 becomes faster and faster relative to Option 3.</DIV>]]>
   </description>
   <pubDate>Sun, 09 Dec 2007 17:38:09 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=598&amp;PID=2148#2148</guid>
  </item> 
  <item>
   <title>Get only changed entities from the database : Thank you for the suggestion....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=598&amp;PID=2147#2147</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=110" rel="nofollow">sieepvvalk</a><br /><strong>Subject:</strong> 598<br /><strong>Posted:</strong> 09-Dec-2007 at 12:16pm<br /><br />Thank you for the suggestion.&nbsp; I want to clarify my understanding of your solution and see if there is any better way to do this.&nbsp; I will present 3 options and hopefully you can help me to figure out which of these is the best way to do things with DevForce.<DIV>&nbsp;</DIV><DIV><strong>OPTION 1:</strong> This is the most basic way we can query for new orders:</DIV><DIV>&nbsp;</DIV><DIV>(1) I run a query that returns 30 orders meeting a certain criteria</DIV><DIV>(2)&nbsp;10 new orders are added&nbsp;to the system over the next 10 minutes</DIV><DIV>(3) I run the same query again, and this time i should get 40 orders.&nbsp; If I use DevForce, I will have to use a DataSourceOnly or DataSourceThenCache QueryStrategy because I need to check the database to get the new orders.&nbsp; This strategy will send all 40 orders back over the network, clogging network resources.</DIV><DIV>&nbsp;</DIV><DIV><strong>OPTION 2:</strong> Your solution is to follow these steps:</DIV><DIV>&nbsp;</DIV><DIV><DIV>(1) I run a query that returns 30 orders meeting a certain criteria</DIV><DIV>(2) I store the date that the query was last run as our&nbsp;(LastRunDate)</DIV><DIV>(3)&nbsp;10 new orders are added&nbsp;to the system over the next 10 minutes.</DIV><DIV>(4) I run a query to get all orders which match my criteria that were added since our (LastRunDate).</DIV><DIV>(5) I merge these new orders with my old orders, thus minimizing network traffic.</DIV><DIV>&nbsp;</DIV><DIV><strong>OPTION 3:</strong> Is options 2 a&nbsp;more optimized solution than the following?</DIV><DIV>&nbsp;</DIV><DIV><DIV>(1) I run a query that returns 30 orders meeting a certain criteria</DIV><DIV>(3)&nbsp;10 new orders are added&nbsp;to the system over the next 10 minutes.</DIV><DIV>(4) I run a query to get all orders which match my criteria and I add a "NOT" clause which excludes order which match the primary keys of the orders already in the list.</DIV><DIV>(5) I merge these new orders with my old orders, thus minimizing network traffic.</DIV></DIV></DIV><DIV>&nbsp;</DIV><DIV>I am wondering what the most optimized way to do this would be.&nbsp; I suppose that since our primary key is automatically indexed, the best processing speed (on the server side)&nbsp;would be to eliminate certain records based on their primary key.&nbsp; This however poses the problem that we are adding a good amount of additional outgoing network traffic to send the list of primary keys to the server.&nbsp; A big concern with our application is speed, so I would like to know which way would be more likely to minimize the overall query time for new orders.</DIV><DIV>&nbsp;</DIV><DIV>I appreciate your help with this issue.</DIV>]]>
   </description>
   <pubDate>Sun, 09 Dec 2007 12:16:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=598&amp;PID=2147#2147</guid>
  </item> 
  <item>
   <title>Get only changed entities from the database :         I think you are...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=598&amp;PID=2146#2146</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> 598<br /><strong>Posted:</strong> 09-Dec-2007 at 10:31am<br /><br /><DIV></DIV><DIV></DIV><DIV></DIV><DIV><TABLE style="MARGIN: auto auto auto 0.25in; WIDTH: 455.4pt; BORDER-COLLAPSE: collapse; mso-padding-alt: 0in 0in 0in 0in" cellSpacing=0 cellPadding=0 width=607 ="Ms&#111;normalTable"><T><T><TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes; page-break-inside: avoid"><TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #ece9d8; WIDTH: 341.55pt; PADDING-TOP: 0in" vAlign=top width=455><SPAN style="mso-bidi-font-size: 10.0pt"><FONT face="Times New Roman" size=2><DIV>I think&nbsp; you are asking for all the entities that have been added or changed using DevForce (or perhaps all entities that have been added or changed recently).</DIV><DIV>&nbsp;</DIV><DIV>My recommendation (if this is possible) is to add CreationTimeStamp (CrtnTs) and ModificationTimeStamp (ModTs) columns (as in Employee table in IdeaBlade Tutorial&nbsp;database).&nbsp; Then you just have to query for objects which have creation or modification time stamps newer than a particular time.</DIV><DIV>&nbsp;</DIV><DIV>With respect to "CacheThenDataSource", I agree that earlier definitions were definitely misleading.&nbsp; Fortunately, we recently cleaned up this documentation.&nbsp; Here is the new description.</DIV><DIV>&nbsp;</DIV><DIV><strong><FONT size=4>CacheThenDataSource</FONT></strong></DIV><DIV>&nbsp;</DIV><DIV>Check the query cache to see if the code has previously submitted the current query or an identifiable superset of it.</FONT><a href="http://www.ideablade.com/forum/RTE_&#116;extarea.asp?mode=reply&amp;POID=2145&amp;ID=229#_ftn1" target="_blank"><SPAN ="MsoFootnoteReference"><SPAN style="mso-special-character: footnote"><SPAN ="MsoFootnoteReference"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-US; mso-fareast-: EN-US; mso-bidi-: AR-SA">&#091;1&#093;</SPAN></SPAN></SPAN></SPAN></A><FONT size=2><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>If so, satisfy the query from the <I style="mso-bidi-font-style: normal">entity cache</I>, and skip the trip to the datasource.<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><O:P></O:P></FONT></FONT></SPAN></DIV><P style="MARGIN: 8pt 0in 0pt" ="Ms&#111;normal"><SPAN style="mso-bidi-font-size: 10.0pt"><FONT size=2><FONT face="Times New Roman">If the query cache contains no query matching or encompassing the current query, DevForce will go to the datasource for the requested data.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Having retrieved data from the datasource into the entity cache, it will then obtain from the entity cache the final set of entity references it returns to the caller.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>By so doing, it will return references to new entities that exist only in the cache, as well as those that duplicate rows from the datasource.<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 8pt 0in 0pt" ="Ms&#111;normal"><SPAN style="mso-bidi-font-size: 10.0pt"><FONT size=2><FONT face="Times New Roman">Some overloads of GetEntity() and GetEntities() permit search for entities by primary key. These queries work differently from those that specify arbitrary criteria. For primary key queries, there is no preliminary search of the query cache for a matching query: rather, DevForce searches the entity cache directly for the provided key value or values. If matching entities are not found in the entity cache, the datasource is also searched.<O:P></O:P></FONT></FONT></SPAN></P></TD></TR></T></T></TABLE><DIV style="mso-element: footnote-list"><BR clear=all><FONT face="Times New Roman" size=2><HR align=left width="33%" SIZE=1></FONT><DIV id=ftn1 style="mso-element: footnote"><P style="MARGIN: 6pt 0in 0pt 0.2in" ="MsoFootnoteText"><a href="http://www.ideablade.com/forum/RTE_&#116;extarea.asp?mode=reply&amp;POID=2145&amp;ID=229#_ftnref1" target="_blank"><SPAN ="MsoFootnoteReference"><SPAN style="mso-special-character: footnote"><SPAN ="MsoFootnoteReference"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-US; mso-fareast-: EN-US; mso-bidi-: AR-SA">&#091;1&#093;</SPAN></SPAN></SPAN></SPAN></A><FONT face="Times New Roman"> For example, if you’re now asking for all Customers from the Eastern region, and you previously retrieved all Customers (without qualification), the all-Customers-without-qualification query will be recognized as a superset of the all-Customers-from-the-Eastern-region query, and the new query will be satisfied from the entity cache.<O:P></O:P></FONT></P></DIV></DIV></DIV><span style="font-size:10px"><br /><br />Edited by davidklitzke - 09-Dec-2007 at 10:32am</span>]]>
   </description>
   <pubDate>Sun, 09 Dec 2007 10:31:48 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=598&amp;PID=2146#2146</guid>
  </item> 
  <item>
   <title>Get only changed entities from the database : Is there any way to get ONLYentities...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=598&amp;PID=2145#2145</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=110" rel="nofollow">sieepvvalk</a><br /><strong>Subject:</strong> 598<br /><strong>Posted:</strong> 08-Dec-2007 at 1:44pm<br /><br />Is there any way to get ONLY&nbsp;entities which have&nbsp;been added or changed&nbsp;using DevForce?<DIV></DIV><DIV>&nbsp;</DIV><DIV>An application we created gets a list of entities at startup.&nbsp; Every 60 seconds, it re-downloads the list from the server to make sure the user is always up to date with the latest changes.&nbsp; In order to do this, we are using a QueryStrategy of "DataSourceThanCache", but this causes ALL the data to be refreshed from the server.&nbsp; This causes excess network traffic and that is something we would like to avoid when only a few records change every 60 seconds.</DIV><DIV>&nbsp;</DIV><DIV>It seems that the "CacheThanDataSource" FetchStrategy is a bit misleading, because it doesn't check the cache THEN get the additional records from the server... it actually should be "CacheORDataSource".&nbsp; Is there something that really does perform a "CacheThanDataSource" query to minimize network traffic?</DIV>]]>
   </description>
   <pubDate>Sat, 08 Dec 2007 13:44:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=598&amp;PID=2145#2145</guid>
  </item> 
 </channel>
</rss>