<?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 : keeping an eye on EntityManager in SL4</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : keeping an eye on EntityManager in SL4</description>
  <pubDate>Tue, 21 Apr 2026 22:30:59 -700</pubDate>
  <lastBuildDate>Wed, 11 Aug 2010 05:03:19 -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=2040</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>keeping an eye on EntityManager in SL4 :   Basically what I wanted to...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=8045#8045</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=877" rel="nofollow">pompomJuice</a><br /><strong>Subject:</strong> 2040<br /><strong>Posted:</strong> 11-Aug-2010 at 5:03am<br /><br /><DIV style="WIDTH: 100%; HEIGHT: 400px; TOP: 0px; LEFT: 0px; -1: "><DIV style="LINE-HEIGHT: 1.4; BORDER-RIGHT-WIDTH: 0px; MARGIN: 1px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; FONT-SIZE: 12px; BORDER-LEFT-WIDTH: 0px; FONT-WEIGHT: normal; -: n&#111;ne; rgb255: "><DIV>Basically what I wanted to achieve is if a query gets fired my back end implementation reports on what is going on with this query. (how long did it take how many records and of what type etc etc.)</DIV><DIV><BR></DIV><DIV>There are 2 approaches that can solve this problem.&nbsp;</DIV><DIV><BR></DIV><DIV>Approach1:</DIV><DIV>Write a wrapper around EntityManager that intercepts what is going on and report on it. I chose not to go this route because...</DIV><DIV><BR></DIV><DIV>Approach2:</DIV><DIV>...I saw that the EntityManager exposes 3 events that looks like it might tell me what is going on with the queries. I implemented those 3 event handlers (Fetching,Querying,Queried), but it was a complete disaster. Those events fire nothing like you'd expect.&nbsp;</DIV><DIV><BR></DIV><DIV>And its not like they fire roughly correctly, they fire almost at random. (Even though EM works perfect) I thought that because those events are so uninformative I could come here and get someone to confirm it. That way I can safely implement approach 1 knowing that approach 2 wont work.</DIV><DIV><BR></DIV><DIV>Unfortunately this has not happened so I believe I am doing something wrong.&nbsp;</DIV><DIV><BR></DIV><DIV>So here are my&nbsp;assumptions&nbsp;so far: (I am always guessing what EM is doing since I don't have the code)</DIV><DIV><BR></DIV><DIV>1.) For a particular query those 3 events should tell me what EM is doing. Right?</DIV><DIV>2.) To "see" what EM loaded from the server I need to look at the EntityQueriedEventArgs of the Queried event. Item 6 explains what I needed assume to make this "work".</DIV><DIV>3.) To determine whether a query was a loaded from the server or a cache hit I check the&nbsp;EntityQueriedEventArgs.WasFetched &amp;&nbsp;IsCompletedSynchronously. (Those two variables seem to function properly)</DIV><DIV>4.) To determine how many records were fetched from the server I check the&nbsp;EntityQueriedEventArgs.ChangedEntities collection as this seems to be the most accurate representation of how many records EM loaded. (why else would they be changed right? Assumptions!)</DIV><DIV>5.) If a query was served by EM's cache, there is no way to determine how many records were in that result set from any of the the 3 events. You just know the cache was hit and thats it.</DIV><DIV>6.) To keep track of what query I am actually looking at in the Queried event I tag the queries with a unique number as they enter the EM. My assumption here is that if a single query spawns multiple other events that they all will have this tag. This helps me combine all the Queried events usually resulting from a single query and extract stats from it. (A single query like the one described in the above posts could sometimes end up making five or six of those Queried events all with the same information in them. I could not find a pattern that explained why sometimes there are many queried events and why other times there are not so many)</DIV><DIV><BR></DIV><DIV>To answer some of your questions:</DIV><DIV><BR></DIV><DIV><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by GregD</strong></em><br /><br /></DIV><DIV><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px" ="apple-style-span">So the second query returned 11 records, not 1 - correct? And you're concerned about the small relative size difference between the two results sets (as reported by your "web development helper" tool)?</SPAN></DIV><DIV></td></tr></table></DIV><DIV>That is correct, it returned 11. 1 Customer and 10 orders. i thought something looked suspicious there.&nbsp;</DIV><DIV><BR></DIV><DIV><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by GregD</strong></em><br /><br /></DIV><DIV><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px" ="apple-style-span">Your tool determined that 95 entities were changed? How does it determine that?</SPAN></DIV><DIV><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px" ="apple-style-span"><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px" ="apple-style-span"></td></tr></table></SPAN></SPAN></DIV><DIV><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px" ="apple-style-span"><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px" ="apple-style-span">By looking at&nbsp;</SPAN></SPAN>EntityQueriedEventArgs.ChangedEntities.</DIV><DIV><BR></DIV><DIV><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by GregD</strong></em><br /><br /></DIV><DIV><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px" ="apple-style-span">Don't be concerned about hurting our feelings. 8-) &nbsp;If there's a problem we'll certainly fix it, but right now I don't have any idea what exactly your custom tool does, or how; or exactly how you're determining that EM is not reporting what it is doing correctly. So, fill us in.</SPAN></DIV><DIV><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px" ="apple-style-span"><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px" ="apple-style-span"></td></tr></table></SPAN></SPAN></DIV><DIV><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px" ="apple-style-span"><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px" ="apple-style-span"><BR></SPAN></SPAN></DIV><DIV><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px" ="apple-style-span"><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px" ="apple-style-span">Good :) I't a LOB application framework that I am starting to build for a 2 year project. I want to use devforce instead of RIA this time because RIA is horrible. This application is my attempt to see how devforce is going to play along.</SPAN></SPAN></DIV><DIV><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px" ="apple-style-span"><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px" ="apple-style-span"><BR></SPAN></SPAN></DIV><DIV><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px" ="apple-style-span"><SPAN style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px" ="apple-style-span">The thing is for me those events fire so strange that I cannot even come here to explain how they misfire. I am finding it very difficult to make a short post that describe the behavior...the best I can come up with is: Random.</SPAN></SPAN></DIV></DIV></DIV><span style="font-size:10px"><br /><br />Edited by pompomJuice - 11-Aug-2010 at 5:14am</span>]]>
   </description>
   <pubDate>Wed, 11 Aug 2010 05:03:19 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=8045#8045</guid>
  </item> 
  <item>
   <title>keeping an eye on EntityManager in SL4 :   Originally posted by pompomJuiceI...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=8036#8036</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 2040<br /><strong>Posted:</strong> 10-Aug-2010 at 1:25pm<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by pompomJuice</strong></em><br /><br />I implemented my little bit of code that attempts to report on what the EntityManager (EM) is doing.&nbsp;<div><br></div><div>To reiterate... I have 2 queries, the second one slightly&nbsp;modified&nbsp;to include "Order" information:</div><div><br></div><div>1.) NorthwindIBEntities.DefaultManager.Customers</div><div>2.) NorthwindIBEntities.DefaultManager.Customers.Where(c =&gt; c.ContactName.StartsWith("a")).Include("Orders")</td></tr></table></div><div><br></div><div><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by pompomJuice</strong></em><br /><br />The results I am getting is that the first query's response was sized at 57KB for all 93 records. The second query's response size is 52KB for 1 record.</div><div><br></div><div>&#091;snip&#093;&nbsp;</div><div><br></div><div>...the query returned 1 customer and 10 orders for that customer)</td></tr></table></div><div><br></div><div>So the second query returned 11 records, not 1 - correct? And you're concerned about the small relative size difference between the two results sets (as reported by your "web development helper" tool)?</div><div><br></div><div><table width="99%"><tr><td class="BBquote">If I dig a little deeper into EM the second query reports that it has caused "95" changed entities in the EM's cache. A bunch of customers and a lot of orders. (even though the query returned 1 customer and 10 orders for that customer)&nbsp;</td></tr></table></div><div><br></div><div>Your tool determined that 95 entities were changed? How does it determine that?</div><div><br></div><div><table width="99%"><tr><td class="BBquote">&nbsp;To put it bluntly, I feel that EM is not reporting what it is doing correctly, which makes it&nbsp;helluva&nbsp;hard to check that the EM is actually doing things optimally.</td></tr></table></div><div><br></div><div>Don't be concerned about hurting our feelings. 8-) &nbsp;If there's a problem we'll certainly fix it, but right now I don't have any idea what exactly your custom tool does, or how; or exactly how you're determining that EM is not reporting what it is doing correctly. So, fill us in.</div><div><br></div><div><br></div>]]>
   </description>
   <pubDate>Tue, 10 Aug 2010 13:25:45 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=8036#8036</guid>
  </item> 
  <item>
   <title>keeping an eye on EntityManager in SL4 :   Inany case.I implemented my...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=8032#8032</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=877" rel="nofollow">pompomJuice</a><br /><strong>Subject:</strong> 2040<br /><strong>Posted:</strong> 10-Aug-2010 at 4:24am<br /><br />In&nbsp;any case.<div><br></div><div>I implemented my little bit of code that attempts to report on what the EntityManager (EM) is doing.&nbsp;</div><div><br></div><div>To reiterate... I have 2 queries, the second one slightly&nbsp;modified&nbsp;to include "Order" information:</div><div><br></div><div>1.) NorthwindIBEntities.DefaultManager.Customers</div><div>2.) NorthwindIBEntities.DefaultManager.Customers.Where(c =&gt; c.ContactName.StartsWith("a")).Include("Orders")</div><div><br></div><div>Disaster once again. I installed that "web development helper" that reports what the browser is doing. The results I am getting is that the first query's response was sized at 57KB for all 93 records. The second query's response size is 52KB for 1 record.</div><div><br></div><div>If I dig a little deeper into EM the second query reports that it has caused "95" changed entities in the EM's cache. A bunch of customers and a lot of orders. (even though the query returned 1 customer and 10 orders for that customer)</div><div><br></div><div>Basically I looked at the results from all angles and I just cannot get the kind of numbers that EM gets when executing that second query. To put it bluntly, I feel that EM is not reporting what it is doing correctly, which makes it&nbsp;helluva&nbsp;hard to check that the EM is actually doing things optimally.</div><div><br></div><div>Should I just leave this and accept I will never really know what the EM is doing and that is working optimally?</div><div><br></div><div>Surely we need some kind of feedback from EM if we are going to customize it for certain situations.</div><div><br></div><div>I don't understand why I am the only person with these kinds of issues, which to me are rather large ones.</div><span style="font-size:10px"><br /><br />Edited by pompomJuice - 10-Aug-2010 at 4:27am</span>]]>
   </description>
   <pubDate>Tue, 10 Aug 2010 04:24:20 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=8032#8032</guid>
  </item> 
  <item>
   <title>keeping an eye on EntityManager in SL4 :   Originally posted by pompomJuicePS-There...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=8021#8021</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 2040<br /><strong>Posted:</strong> 06-Aug-2010 at 7:54am<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by pompomJuice</strong></em><br /><br />PS-There is something weird in these forums where it keeps on adding massive amounts of whitespace at the end of a post if you edit it a lot.</td></tr></table><div><br></div><div>I dunno. The thing I've noticed is that if you use tags like QUOTE, CODE, etc., it likes them squeezed up as close as possible to the content; otherwise, it inserts a bunch of white space. &nbsp;I have absolutely no extra characters (including end-of-line) at the end of this post, so let's see what happens.</div>]]>
   </description>
   <pubDate>Fri, 06 Aug 2010 07:54:58 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=8021#8021</guid>
  </item> 
  <item>
   <title>keeping an eye on EntityManager in SL4 :       Originally posted...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=8016#8016</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=877" rel="nofollow">pompomJuice</a><br /><strong>Subject:</strong> 2040<br /><strong>Posted:</strong> 06-Aug-2010 at 12:20am<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by GregD</strong></em><br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by pompomJuice</strong></em><br /><br />That must have been a interesting discussion. All this caching is terribly wonderful until you have multiple clients that CRUD the same tables. Then it becomes something else... O_o</td></tr></table><div><br></div><div>Well, the good news is that you have the <i>option</i> of staying off the server when you don't need to go there. Or going there when it makes sense.</div></td></tr></table><div><br></div><div>Agreed.&nbsp;</div><div><br></div><div>DevForce gives&nbsp;excellent&nbsp;control over almost anything you can think of.&nbsp;Now that I know what behavior&nbsp;is intended I can continue customizing it to my needs.</div><div><br></div><div>PS-There is something weird in these forums where it keeps on adding massive amounts of whitespace at the end of a post if you edit it a lot.</div><span style="font-size:10px"><br /><br />Edited by pompomJuice - 06-Aug-2010 at 12:25am</span>]]>
   </description>
   <pubDate>Fri, 06 Aug 2010 00:20:58 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=8016#8016</guid>
  </item> 
  <item>
   <title>keeping an eye on EntityManager in SL4 : That must have been a interesting...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=8001#8001</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 2040<br /><strong>Posted:</strong> 05-Aug-2010 at 10:37am<br /><br />&#091;/QUOTE&#093;That must have been a interesting discussion. All this caching is terribly wonderful until you have multiple clients that CRUD the same tables. Then it becomes something else... O_o&#091;/QUOTE&#093;<div><br></div><div>Well, the good news is that you have the <i>option</i> of staying off the server when you don't need to go there. Or going there when it makes sense.</div>]]>
   </description>
   <pubDate>Thu, 05 Aug 2010 10:37:56 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=8001#8001</guid>
  </item> 
  <item>
   <title>keeping an eye on EntityManager in SL4 :    Originally posted by GregDI...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7993#7993</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=877" rel="nofollow">pompomJuice</a><br /><strong>Subject:</strong> 2040<br /><strong>Posted:</strong> 05-Aug-2010 at 1:47am<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by GregD</strong></em><br /><br />I think it's more because we're not sure the use case is compelling (and unequivocal).<div><br></div></td></tr></table><div><br></div><div>That must have been a interesting discussion. All this caching is terribly wonderful until you have multiple clients that CRUD the same tables. Then it becomes something else... O_o</div><span style="font-size:10px"><br /><br />Edited by pompomJuice - 05-Aug-2010 at 2:00am</span>]]>
   </description>
   <pubDate>Thu, 05 Aug 2010 01:47:53 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7993#7993</guid>
  </item> 
  <item>
   <title>keeping an eye on EntityManager in SL4 :         Originally posted...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7991#7991</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=877" rel="nofollow">pompomJuice</a><br /><strong>Subject:</strong> 2040<br /><strong>Posted:</strong> 05-Aug-2010 at 1:30am<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by GregD</strong></em><br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by jsobell</strong></em><br /><br />I don't follow what this has to do with double-events firing.<br>If the first case (unrestricted) always goes to the database, why would the second one call Query twice then Fetch twice?<br>I could sort of understand Query-Fectch-Query-Fetch...<br><br></td></tr></table><div><br></div><div>I am unable to reproduce the scenario of double events firing. In a test, I set up handlers for querying, fetching, and queried, then&nbsp;issued an unrestricted query for Customers, then a restricted one for Customers. Handlers were hit only once for each query. &nbsp; How did you determine they were hit twice?</div></td></tr></table><div><br></div><div>Strange.</div><div><br></div><div>You are using Silverlight right? I did nothing fancy on my side. I connected to that Northwind database that comes with the installs and made a async query. I determined the order by using breakpoints in each event handler. Regardless, even though I might have measured asynchronous&nbsp;events incorrectly that is not what is bothering me. Those two queried events that fire are the ones confusing me, because it makes it hard to follow what the EntityManager is doing... I made 1 query it says it made 2, with both having WasFetched=true;</div><span style="font-size:10px"><br /><br />Edited by pompomJuice - 05-Aug-2010 at 2:00am</span>]]>
   </description>
   <pubDate>Thu, 05 Aug 2010 01:30:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7991#7991</guid>
  </item> 
  <item>
   <title>keeping an eye on EntityManager in SL4 :    Originally posted by pompomJuiceI...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7988#7988</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 2040<br /><strong>Posted:</strong> 04-Aug-2010 at 4:24pm<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by pompomJuice</strong></em><br /><br />&nbsp;<br>I was wondering how you could accurately determine that a particular query already has a similar unrestricted query in the query cache. That can't be easy to achieve?</td></tr></table><div><br></div><div>I didn't write the code, and Classic was a different animal, as there was no Entity Framework and no LINQ. &nbsp;And since we're not checking this in the current version, there is no current implementation. &nbsp;But I don't think that's because there's anything particularly hard about identifying a given query as "unrestricted". I think it's more because we're not sure the use case is compelling (and unequivocal).</div><div><br></div><span style="font-size:10px"><br /><br />Edited by GregD - 04-Aug-2010 at 6:03pm</span>]]>
   </description>
   <pubDate>Wed, 04 Aug 2010 16:24:38 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7988#7988</guid>
  </item> 
  <item>
   <title>keeping an eye on EntityManager in SL4 : This was just a question relating...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7987#7987</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 2040<br /><strong>Posted:</strong> 04-Aug-2010 at 4:17pm<br /><br />This was just a question relating to "pompomJuice's" (?!) comment:<DIV>Event sequence: Querying-&gt;Querying-&gt;Fetching-&gt;Fetching-&gt;Queried-&gt;Queried <BR></DIV><DIV>I haven't tried tracing this in our code, I was just interested to know why the&nbsp;manager might generate this sequence in such an odd order when data was cached.</DIV>]]>
   </description>
   <pubDate>Wed, 04 Aug 2010 16:17:29 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7987#7987</guid>
  </item> 
  <item>
   <title>keeping an eye on EntityManager in SL4 :   Originally posted by jsobellI...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7986#7986</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 2040<br /><strong>Posted:</strong> 04-Aug-2010 at 4:13pm<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by jsobell</strong></em><br /><br />I don't follow what this has to do with double-events firing.<br>If the first case (unrestricted) always goes to the database, why would the second one call Query twice then Fetch twice?<br>I could sort of understand Query-Fectch-Query-Fetch...<br><br></td></tr></table><div><br></div><div>I am unable to reproduce the scenario of double events firing. In a test, I set up handlers for querying, fetching, and queried, then&nbsp;issued an unrestricted query for Customers, then a restricted one for Customers. Handlers were hit only once for each query. &nbsp; How did you determine they were hit twice?</div>]]>
   </description>
   <pubDate>Wed, 04 Aug 2010 16:13:59 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7986#7986</guid>
  </item> 
  <item>
   <title>keeping an eye on EntityManager in SL4 :  Originally posted by GregDThe...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7955#7955</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=877" rel="nofollow">pompomJuice</a><br /><strong>Subject:</strong> 2040<br /><strong>Posted:</strong> 03-Aug-2010 at 12:58am<br /><br /> <table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by GregD</strong></em><br /><br />The documentation was in error regarding the behavior after an unrestricted query. The correct rule is that DevForce always goes to the data source unless it has seen a specific query before.<br /><br />The documented behavior remains true in DevForce Classic. It was&nbsp;&nbsp;&nbsp;originally motivated there in support of something called enumeration entities, which were based on data that seldom changed.</td></tr></table> <br /><br />That is quite a significant "error".<br /><br />I was wondering how you could accurately determine that a particular query already has a similar unrestricted query in the query cache. That can't be easy to achieve?<br /><br /><br /><br /> ]]>
   </description>
   <pubDate>Tue, 03 Aug 2010 00:58:38 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7955#7955</guid>
  </item> 
  <item>
   <title>keeping an eye on EntityManager in SL4 : I don&amp;#039;t follow what this...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7953#7953</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 2040<br /><strong>Posted:</strong> 02-Aug-2010 at 11:09pm<br /><br />I don't follow what this has to do with double-events firing.<br>If the first case (unrestricted) always goes to the database, why would the second one call Query twice then Fetch twice?<br>I could sort of understand Query-Fectch-Query-Fetch...<br><br>]]>
   </description>
   <pubDate>Mon, 02 Aug 2010 23:09:56 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7953#7953</guid>
  </item> 
  <item>
   <title>keeping an eye on EntityManager in SL4 : The documentation was in error...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7952#7952</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 2040<br /><strong>Posted:</strong> 02-Aug-2010 at 4:42pm<br /><br />The documentation was in error regarding the behavior after an unrestricted query. The correct rule is that DevForce always goes to the data source unless it has seen a specific query before.<br /><br />The documented behavior remains true in DevForce Classic. It was&nbsp;&nbsp;&nbsp;originally motivated there in support of something called enumeration entities, which were based on data that seldom changed.]]>
   </description>
   <pubDate>Mon, 02 Aug 2010 16:42:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7952#7952</guid>
  </item> 
  <item>
   <title>keeping an eye on EntityManager in SL4 : Hi.  I am trying to extract some...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7948#7948</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=877" rel="nofollow">pompomJuice</a><br /><strong>Subject:</strong> 2040<br /><strong>Posted:</strong> 02-Aug-2010 at 4:28am<br /><br />Hi.<br /><br />I am trying to extract some information from the EntityManager (EM) on its inner workings when you submit an Async query. I mostly want this information so that I can make better performance decisions.<br /><br />After little digging I found these 3 events: Querying,Fetching,Queried.<br /><br />After some hours of development I failed to extract useful information for the client when it is in debug mode.<br /><br />What am I missing here? I read up on the developers guide about how everything works but those events fire nothing like what you would expect. Let me give a simple example:<br /><br />Query:<strong>NorthwindIBEntities.DefaultManager.Customers</strong><br />Event sequence: Querying-&gt;Fetching-&gt;Queried<br />Interpretation: All good. EM searches it's cache finds nothing thus resubmits the query as a "fetch from datasource". Results are returned. So far so good.<br /><br />Query:<strong>NorthwindIBEntities.DefaultManager.Customers.Where(c =&gt; c.ContactName.StartsWith("a")).With(QueryStrategy.Normal)</strong><br />Event sequence: Querying-&gt;Querying-&gt;Fetching-&gt;Fetching-&gt;Queried-&gt;Queried<br />Interpretation: Not cool at all. That result should be fetched from cache? Instead it fires 2 Fetching events and I receive 2 Queried events because of it.Using Fiddler I can see that it only received 1 result from the data source. But why the spamming of the events? It makes it very hard to make sense what just happened?<br /><br />All I wanted from that second query was a string generated that looks like this: "Queried Customer &#091;1 record(s); 0.2s, 300r/s&#093;" but there is no way I can combine all information given by those events to do this.<br /><br />Further more, if i change my QueryStratigy to CacheOnly it suddenly works as expected, why could the normal query stratigy not accomplish a cache hit also?<br /><br />Any thoughts?<br /><br /><br /><br /><br /><br /><br /><br /><br /><span style="font-size:10px"><br /><br />Edited by pompomJuice - 02-Aug-2010 at 5:33am</span>]]>
   </description>
   <pubDate>Mon, 02 Aug 2010 04:28:50 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2040&amp;PID=7948#7948</guid>
  </item> 
 </channel>
</rss>