<?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 : BaseEntity.OnPropertyChanged--Performance Hit</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : BaseEntity.OnPropertyChanged--Performance Hit</description>
  <pubDate>Thu, 11 Jun 2026 16:35:37 -700</pubDate>
  <lastBuildDate>Wed, 10 Oct 2007 09:27:20 -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=371</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>BaseEntity.OnPropertyChanged--Performance Hit : I highly reccommend the ANTS Profiler...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=371&amp;PID=1532#1532</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=38" rel="nofollow">rclarke</a><br /><strong>Subject:</strong> 371<br /><strong>Posted:</strong> 10-Oct-2007 at 9:27am<br /><br />I highly reccommend the ANTS Profiler from Red-Gate. It helped me with my performance problem and pointed dirtectly to the OnPropertyChanged which led me to the solution above. It's a great tool.]]>
   </description>
   <pubDate>Wed, 10 Oct 2007 09:27:20 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=371&amp;PID=1532#1532</guid>
  </item> 
  <item>
   <title>BaseEntity.OnPropertyChanged--Performance Hit : I found the problem, I wasn&amp;#039;t...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=371&amp;PID=1531#1531</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=169" rel="nofollow">PJones</a><br /><strong>Subject:</strong> 371<br /><strong>Posted:</strong> 10-Oct-2007 at 8:56am<br /><br />I found the problem, I wasn't referencing IdeaBlade.Verification.&nbsp; Once I did the property showed up as in your example.<DIV>&nbsp;</DIV><DIV>Unfourtunately, I still have a huge performance issue writing bulk data.</DIV><DIV>&nbsp;</DIV><DIV>Thanks,</DIV><DIV>&nbsp;</DIV><DIV>Pete</DIV>]]>
   </description>
   <pubDate>Wed, 10 Oct 2007 08:56:31 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=371&amp;PID=1531#1531</guid>
  </item> 
  <item>
   <title>BaseEntity.OnPropertyChanged--Performance Hit : That&amp;#039;s odd, here is the actual...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=371&amp;PID=1529#1529</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=38" rel="nofollow">rclarke</a><br /><strong>Subject:</strong> 371<br /><strong>Posted:</strong> 10-Oct-2007 at 8:42am<br /><br />That's odd, here is the actual line of code I use:<DIV></DIV><DIV><P><FONT size=3><FONT size=2>MainPm.Manager.VerifierEngine.Enabled = <FONT color=#0000ff>False</P><DIV><FONT color=#000000>Of course, I have defined MainPM as a class in my application which returns the primary perstistance managger through the Manager property. The following is the class:</FONT></DIV><DIV><FONT color=#000000></FONT>&nbsp;</DIV><DIV><FONT color=#008000 size=3><P><FONT size=1>''' </FONT></FONT><FONT size=1><FONT color=#808080>&lt;summary&gt;</FONT><FONT color=#008000>Application's main PersistenceManager. Initializes. See </FONT><FONT color=#808080>&lt;see cref="MainPm.Manager"/&gt;</FONT><FONT color=#008000>.</FONT><FONT color=#808080>&lt;/summary&gt;</P></FONT></FONT><FONT color=#0000ff><P><FONT size=1>Public</FONT></FONT><FONT size=1><FONT color=#000000> </FONT><FONT color=#0000ff>NotInheritable</FONT><FONT color=#000000> </FONT><FONT color=#0000ff>Class</FONT><FONT color=#000000> MainPm</FONT></FONT></P><P><FONT size=1><FONT color=#008000>''' </FONT><FONT color=#808080>&lt;summary&gt;</FONT><FONT color=#008000>Do not allow new MainPm instances.</FONT><FONT color=#808080>&lt;/summary&gt;</P></FONT></FONT><P><FONT size=1><FONT color=#0000ff>Private</FONT> <FONT color=#0000ff>Sub</FONT> <FONT color=#0000ff>New</FONT>()</FONT></P><P><FONT size=1><FONT color=#0000ff>End</FONT> <FONT color=#0000ff>Sub</P></FONT></FONT><P><FONT size=1><FONT color=#008000>''' </FONT><FONT color=#808080>&lt;summary&gt;</FONT><FONT color=#008000>Application's main PersistenceManager.</FONT><FONT color=#808080>&lt;/summary&gt;</P></FONT></FONT><P><FONT size=1><FONT color=#0000ff>Public</FONT> <FONT color=#0000ff>Shared</FONT> <FONT color=#0000ff>ReadOnly</FONT> <FONT color=#0000ff>Property</FONT> Manager() <FONT color=#0000ff>As</FONT> PersistenceManager</FONT></P><P><FONT color=#0000ff><FONT size=1>Get</FONT></P></FONT><P><FONT size=1><FONT color=#0000ff>If</FONT> msManager <FONT color=#0000ff>Is</FONT> <FONT color=#0000ff>Nothing</FONT> <FONT color=#0000ff>Then</P></FONT></FONT><P><FONT size=1>Initialize()</FONT></P><P><FONT size=1><FONT color=#0000ff>End</FONT> <FONT color=#0000ff>If</P></FONT></FONT><P><FONT size=1><FONT color=#0000ff>Return</FONT> msManager</FONT></P><P><FONT size=1><FONT color=#0000ff>End</FONT> <FONT color=#0000ff>Get</P></FONT></FONT><P><FONT size=1><FONT color=#0000ff>End</FONT> <FONT color=#0000ff>Property</P></FONT></FONT><P><FONT size=1><FONT color=#0000ff>Private</FONT> <FONT color=#0000ff>Shared</FONT> <FONT color=#0000ff>Sub</FONT> Initialize()</FONT></P><P><FONT size=1>msManager = PersistenceManager.DefaultManager</FONT></P><P><FONT size=1>Model.Common.EntityTypeInfo.DefaultPersistenceManager = msManager</FONT></P><P><FONT size=1>EntityAdapter.DefaultPersistenceManager = msManager</FONT></P><P><FONT size=1>UpdateAuditColumnsOnChange()</FONT></P><P><FONT size=1><FONT color=#0000ff>End</FONT> <FONT color=#0000ff>Sub</P></FONT></FONT><P><FONT size=1><FONT color=#008000>''' </FONT><FONT color=#808080>&lt;summary&gt;</FONT><FONT color=#008000>Update entity audit columns everytime the entity changes.</FONT><FONT color=#808080>&lt;/summary&gt;</P></FONT></FONT><P><FONT size=1><FONT color=#0000ff>Private</FONT> <FONT color=#0000ff>Shared</FONT> <FONT color=#0000ff>Sub</FONT> UpdateAuditColumnsOnChange()</FONT></P><P><FONT size=1>msAuditColumnManagers = <FONT color=#0000ff>New</FONT> AuditColumnManagerCollection(msManager)</FONT></P><P><FONT size=1><FONT color=#0000ff>End</FONT> <FONT color=#0000ff>Sub</P></FONT></FONT><P><FONT size=1>#<FONT color=#0000ff>Region</FONT> <FONT color=#a31515>"IsClientProcess"</P></FONT></FONT><P><FONT size=1><FONT color=#008000>''' </FONT><FONT color=#808080>&lt;summary&gt;</FONT><FONT color=#008000>Get or set if executing on the client.</FONT><FONT color=#808080>&lt;/summary&gt;</P></FONT></FONT><P><FONT size=1><FONT color=#0000ff>Public</FONT> <FONT color=#0000ff>Shared</FONT> <FONT color=#0000ff>Property</FONT> IsClientProcess() <FONT color=#0000ff>As</FONT> <FONT color=#0000ff>Boolean</P></FONT></FONT><P><FONT color=#008000><FONT size=1>' No threading worry because only set once and always in the same direction.</FONT></P></FONT><P><FONT color=#0000ff><FONT size=1>Get</FONT></P></FONT><P><FONT size=1><FONT color=#0000ff>If</FONT> msIsClientProcess.HasValue <FONT color=#0000ff>Then</P></FONT></FONT><P><FONT size=1><FONT color=#0000ff>Return</FONT> msIsClientProcess.Value</FONT></P><P><FONT size=1><FONT color=#0000ff>End</FONT> <FONT color=#0000ff>If</P></FONT></FONT><P><FONT size=1>IsClientProcess = <FONT color=#0000ff>False</FONT> <FONT color=#008000>' assume is server process until know otherwise.</P></FONT></FONT><P><FONT size=1><FONT color=#0000ff>Return</FONT> msIsClientProcess.Value</FONT></P><P><FONT size=1><FONT color=#0000ff>End</FONT> <FONT color=#0000ff>Get</P></FONT></FONT><P><FONT size=1><FONT color=#0000ff>Set</FONT>(<FONT color=#0000ff>ByVal</FONT> value <FONT color=#0000ff>As</FONT> <FONT color=#0000ff>Boolean</FONT>)</FONT></P><P><FONT size=1><FONT color=#0000ff>If</FONT> msIsClientProcess.HasValue <FONT color=#0000ff>Then</P></FONT></FONT><P><FONT size=1><FONT color=#0000ff>Throw</FONT> <FONT color=#0000ff>New</FONT> InvalidOperationException(<FONT color=#a31515>"'IsClientProcess' is already set; can only set it once."</FONT>)</FONT></P><P><FONT color=#0000ff><FONT size=1>Else</FONT></P></FONT><P><FONT size=1>msIsClientProcess = Value</FONT></P><P><FONT color=#008000><FONT size=1>' Tell DataSourceKeyResolver about it.</FONT></P></FONT><P><FONT color=#008000><FONT size=1>'AppHelper.DataSourceKeyResolver.IsClientProcess = msIsClientProcess.Value</FONT></P></FONT><P><FONT size=1><FONT color=#0000ff>End</FONT> <FONT color=#0000ff>If</P></FONT></FONT><P><FONT size=1><FONT color=#0000ff>End</FONT> <FONT color=#0000ff>Set</P></FONT></FONT><P><FONT size=1><FONT color=#0000ff>End</FONT> <FONT color=#0000ff>Property</P></FONT></FONT><P><FONT size=1>#<FONT color=#0000ff>End</FONT> <FONT color=#0000ff>Region</P></FONT></FONT><P><FONT size=1>#<FONT color=#0000ff>Region</FONT> <FONT color=#a31515>"Private Field Members"</P></FONT></FONT><P><FONT size=1><FONT color=#0000ff>Private</FONT> <FONT color=#0000ff>Shared</FONT> msManager <FONT color=#0000ff>As</FONT> PersistenceManager</FONT></P><P><FONT size=1><FONT color=#0000ff>Private</FONT> <FONT color=#0000ff>Shared</FONT> msIsClientProcess <FONT color=#0000ff>As</FONT> Nullable(<FONT color=#0000ff>Of</FONT> <FONT color=#0000ff>Boolean</FONT>)</FONT></P><P><FONT size=1><FONT color=#0000ff>Private</FONT> <FONT color=#0000ff>Shared</FONT> msAuditColumnManagers <FONT color=#0000ff>As</FONT> AuditColumnManagerCollection</FONT></P><P><FONT size=1>#<FONT color=#0000ff>End</FONT> </FONT><FONT color=#0000ff><FONT size=1>Region</FONT></P><P><FONT size=1>End</FONT></FONT><FONT size=1><FONT color=#000000> </FONT><FONT color=#0000ff size=3>Class</P></FONT></FONT></DIV></FONT></FONT></FONT></DIV>]]>
   </description>
   <pubDate>Wed, 10 Oct 2007 08:42:33 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=371&amp;PID=1529#1529</guid>
  </item> 
  <item>
   <title>BaseEntity.OnPropertyChanged--Performance Hit : Um, in my persistencemanager object...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=371&amp;PID=1524#1524</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=169" rel="nofollow">PJones</a><br /><strong>Subject:</strong> 371<br /><strong>Posted:</strong> 10-Oct-2007 at 5:14am<br /><br />Um, in my persistencemanager object the VerifierEngine has no .Enabled properties...<DIV>&nbsp;</DIV><DIV>Or am I looking in the wrong place?</DIV><DIV>&nbsp;</DIV><DIV>Pete Jones</DIV>]]>
   </description>
   <pubDate>Wed, 10 Oct 2007 05:14:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=371&amp;PID=1524#1524</guid>
  </item> 
  <item>
   <title>BaseEntity.OnPropertyChanged--Performance Hit : Thanks for the help. I guess brilliant...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=371&amp;PID=970#970</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=38" rel="nofollow">rclarke</a><br /><strong>Subject:</strong> 371<br /><strong>Posted:</strong> 23-Aug-2007 at 8:56am<br /><br />Thanks for the help. I guess brilliant minds think alike :-), I had implemented just those changes but I did no post because I was still testing. Instead of overriding the OnPropertyChanged, I actually added a boolean to my base entity and then test the boolean in the OnPropertyChanged before executing. A little different but both solutions seem to work well.]]>
   </description>
   <pubDate>Thu, 23 Aug 2007 08:56:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=371&amp;PID=970#970</guid>
  </item> 
  <item>
   <title>BaseEntity.OnPropertyChanged--Performance Hit : Where can be couple of issues...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=371&amp;PID=969#969</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=123" rel="nofollow">owais,zahid</a><br /><strong>Subject:</strong> 371<br /><strong>Posted:</strong> 23-Aug-2007 at 8:45am<br /><br /><P>Where can be couple of issues related to the performance hit. You should do the following things.</P><DIV>1) During batch update, make sure that the verifierengine of the entity or persistanceManager is disable. By this, the persistence Manager will not verify the entities to be updated (this can be bit risky but if normally batch updates are not prone to user related errors). </DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PersistenceManager.VerifierEnginer.Enable = false;</DIV><DIV>&nbsp;</DIV><DIV>2) Override the OnPropertyChanged on your batch entities and control the call to base using boolean variable.</DIV><DIV>&nbsp;</DIV><DIV>Hope that works for you.</DIV>]]>
   </description>
   <pubDate>Thu, 23 Aug 2007 08:45:45 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=371&amp;PID=969#969</guid>
  </item> 
  <item>
   <title>BaseEntity.OnPropertyChanged--Performance Hit : I use a base entity for my classes...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=371&amp;PID=926#926</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=38" rel="nofollow">rclarke</a><br /><strong>Subject:</strong> 371<br /><strong>Posted:</strong> 15-Aug-2007 at 8:29am<br /><br />I use a base entity for my classes to inherit from in order to provide common behavior for all classes. In the base entity class I have the following code:<DIV>&nbsp;</DIV><DIV><P><FONT size=2><FONT color=#008000>''' </FONT><FONT color=#808080>&lt;summary&gt;</FONT><FONT color=#008000>Raises OnPropertyChanged event for the property named pPropertyName.</FONT><FONT color=#808080>&lt;/summary&gt;</P></FONT></FONT><P><FONT size=2><FONT color=#008000>''' </FONT><FONT color=#808080>&lt;remarks&gt;</FONT><FONT color=#008000>Typically called inside a custom property setter.</FONT><FONT color=#808080>&lt;/remarks&gt;</P></FONT></FONT><P><FONT size=2><FONT color=#0000ff>Protected</FONT> <FONT color=#0000ff>Overloads</FONT> <FONT color=#0000ff>Sub</FONT> OnPropertyChanged(<FONT color=#0000ff>ByVal</FONT> pPropertyName <FONT color=#0000ff>As</FONT> <FONT color=#0000ff>String</FONT>)</FONT></P><P><FONT size=2>OnPropertyChanged(<FONT color=#0000ff>New</FONT> PropertyChangedEventArgs(pPropertyName))</FONT></P><P><FONT size=2><FONT color=#0000ff>End</FONT> <FONT color=#0000ff>Sub</P><DIV></FONT></FONT><FONT size=2><FONT color=#008000>''' </FONT><FONT color=#808080>&lt;summary&gt;</FONT><FONT color=#008000>Raises OnPropertyChanged event for the property described by a pPropertyDescriptor.</FONT><FONT color=#808080>&lt;/summary&gt;</DIV></FONT></FONT><P><FONT size=2><FONT color=#008000>''' </FONT><FONT color=#808080>&lt;remarks&gt;</FONT><FONT color=#008000>Typically called inside a custom property setter.</FONT><FONT color=#808080>&lt;/remarks&gt;</P></FONT></FONT><P><FONT size=2><FONT color=#0000ff>Public</FONT> <FONT color=#0000ff>Overloads</FONT> <FONT color=#0000ff>Sub</FONT> OnPropertyChanged(<FONT color=#0000ff>ByVal</FONT> pPropertyDescriptor <FONT color=#0000ff>As</FONT> PropertyDescriptor)</FONT></P><P><FONT size=2>OnPropertyChanged(<FONT color=#0000ff>New</FONT> PropertyChangedEventArgs(pPropertyDescriptor.Name))</FONT></P><P><FONT size=3><FONT size=2><FONT color=#0000ff>End</FONT> <FONT color=#0000ff>Sub</P><DIV><FONT color=#000000 size=1>I was having a performance problem in a batch database update function which was taking much too long; the entire operation took over 15 min. After commenting out the OnPropertyChanged code above the same process ran in less that 30 sec. What a difference. So if ypu're experiencing similar performance issues and have implemented the above, you should consider what I did.</FONT></DIV><DIV><FONT color=#000000 size=1></FONT>&nbsp;</DIV><DIV><FONT color=#000000 size=1>Unfortunately, I depend on the OnPropertyChanged event in other parts of my code so I need to look at dynamically turning it on and off depending of the need.</FONT></DIV></FONT></FONT></FONT></DIV>]]>
   </description>
   <pubDate>Wed, 15 Aug 2007 08:29:55 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=371&amp;PID=926#926</guid>
  </item> 
 </channel>
</rss>