<?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 : Can&#039;t seem to stop the verification engine.</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Can&#039;t seem to stop the verification engine.</description>
  <pubDate>Thu, 25 Jun 2026 03:50:51 -700</pubDate>
  <lastBuildDate>Mon, 15 Nov 2010 15:20:17 -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=2298</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>Can&#039;t seem to stop the verification engine. : 1) First define a &amp;#034;composition...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2298&amp;PID=9126#9126</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 2298<br /><strong>Posted:</strong> 15-Nov-2010 at 3:20pm<br /><br /><FONT face="Verdana, Arial, Helvetica, sans-serif">1) First define a "composition context resolver" on both client and server: </FONT><DIV><PRE style="FONT-FAMILY: c&#111;nsolas">&nbsp;&nbsp;<SPAN style="COLOR: blue">public</SPAN>&nbsp;<SPAN style="COLOR: blue">class</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">MyCompositionContextResolver</SPAN>&nbsp;:&nbsp;<SPAN style="COLOR: #2b91af">BaseCompositionContextResolver</SPAN>&nbsp;{<BR> <BR><PRE style="FONT-FAMILY: c&#111;nsolas">&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">public</SPAN>&nbsp;<SPAN style="COLOR: blue">static</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">CompositionContext</SPAN>&nbsp;CustomContext&nbsp;=&nbsp;<SPAN style="COLOR: blue">new</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">CompositionContext</SPAN>(<SPAN style="COLOR: #a31515">"NonValidatingBatch"</SPAN>,&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">false</SPAN>,&nbsp;<SPAN style="COLOR: blue">new</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">Type</SPAN>&#091;&#093;&nbsp;{&nbsp;<SPAN style="COLOR: blue">typeof</SPAN>(<SPAN style="COLOR: #2b91af">NonValidatingSaveInterceptor</SPAN>)&nbsp;});</PRE>&nbsp;&nbsp;&nbsp;}</PRE></DIV><DIV><PRE style="FONT-FAMILY: c&#111;nsolas"><PRE style="FONT-FAMILY: c&#111;nsolas"><FONT face="Verdana, Arial, Helvetica, sans-serif">2) Define a custom save interceptor on the server:</FONT></PRE><PRE style="FONT-FAMILY: c&#111;nsolas"><PRE style="FONT-FAMILY: c&#111;nsolas">&nbsp;&nbsp;&#091;<SPAN style="COLOR: #2b91af">PartNotDiscoverable</SPAN>&#093;<BR>&nbsp;&nbsp;<SPAN style="COLOR: blue">public</SPAN>&nbsp;<SPAN style="COLOR: blue">class</SPAN>&nbsp;<SPAN style="COLOR: #2b91af">NonValidatingSaveInterceptor</SPAN>&nbsp;:&nbsp;<SPAN style="COLOR: #2b91af">EntityServerSaveInterceptor</SPAN>&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">protected</SPAN>&nbsp;<SPAN style="COLOR: blue">override</SPAN>&nbsp;<SPAN style="COLOR: blue">bool</SPAN>&nbsp;ValidateSave()&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: blue">return</SPAN>&nbsp;<SPAN style="COLOR: blue">true</SPAN>;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}</PRE><PRE style="FONT-FAMILY: c&#111;nsolas">&nbsp;</PRE><PRE style="FONT-FAMILY: c&#111;nsolas"><FONT face="Verdana, Arial, Helvetica, sans-serif">3) In the client code, provide the "composition context name":</FONT></PRE><PRE style="FONT-FAMILY: c&#111;nsolas"><P><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>  var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> entities = </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>PrimeSystem</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.CreatePrimeEntities(compositionContextName:&nbsp;<SPAN style="COLOR: #2b91af">MyCompositionContextResolver</SPAN>.CustomContext.Name<BR></P><P>);</P></FONT></FONT></PRE></PRE></PRE></DIV>]]>
   </description>
   <pubDate>Mon, 15 Nov 2010 15:20:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2298&amp;PID=9126#9126</guid>
  </item> 
  <item>
   <title>Can&#039;t seem to stop the verification engine. : Thanks!This really helped.If it...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2298&amp;PID=9103#9103</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=916" rel="nofollow">BringerOD</a><br /><strong>Subject:</strong> 2298<br /><strong>Posted:</strong> 13-Nov-2010 at 9:27am<br /><br />Thanks!<div><br></div><div>This really helped.</div><div><br></div><div>If it is not too much trouble, it would be great to see the CompositionContext only sample.</div><div><br></div><div><br></div>]]>
   </description>
   <pubDate>Sat, 13 Nov 2010 09:27:02 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2298&amp;PID=9103#9103</guid>
  </item> 
  <item>
   <title>Can&#039;t seem to stop the verification engine. : I was afraid you were going to...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2298&amp;PID=9101#9101</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 2298<br /><strong>Posted:</strong> 12-Nov-2010 at 4:43pm<br /><br />I was afraid you were going to need this for&nbsp;a specific operation within the wider application.&nbsp; There's no built-in way to pass some sort of tag along with the save to identify a specific "batch", unlike a query which does have a Tag property.&nbsp; You can simulate this, however, by adding a Tag (or whatever you want to call it) to the entity definition(s) for any entities you might work with in the batch.&nbsp; If there are quite a few entities, then maybe add the property to a base class.&nbsp; As long as the property has a public getter and setter and is marked as a DataMember, it will be serialized with the rest of the entity properties when the save is requested.&nbsp; This is unfortunately not secure though, since it allows&nbsp;the client application to turn off server validation, so you'd need to take care that only authorized users can perform saves.<DIV>&nbsp;</DIV><DIV>Here's a simple example - </DIV><DIV>&nbsp;</DIV><DIV>public partial class Lead {</DIV><DIV>&nbsp;&nbsp; System.Runtime.Serialization.DataMember&#093;<BR>&nbsp;&nbsp; public bool&nbsp;BypassServerValidation { get; set; }<BR>}</DIV><DIV>&nbsp;</DIV><DIV>In the save interceptor - </DIV><DIV>&nbsp; protected override bool ValidateSave() {<BR>&nbsp;&nbsp;&nbsp; var&nbsp;changes = EntityManager.FindEntities(EntityState.AnyAddedModifiedOrDeleted).OfType&lt;Lead&gt;();<BR>&nbsp;&nbsp;&nbsp; if (changes.Any(e =&gt; e.BypassServerValidation)) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;<BR>&nbsp;&nbsp;&nbsp; } else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return base.ValidateSave();<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; }<BR></DIV><DIV>Another option, if you can use a separate EntityManager for the batch, is to use a different CompostionContext for the batch, and define a custom save interceptor which bypasses validation for this CompositionContext only.&nbsp; This is likely not as complicated as it sounds, and if you're interested I'll get a quick sample together for you.</DIV>]]>
   </description>
   <pubDate>Fri, 12 Nov 2010 16:43:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2298&amp;PID=9101#9101</guid>
  </item> 
  <item>
   <title>Can&#039;t seem to stop the verification engine. : Thanks for the reply. That makes...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2298&amp;PID=9097#9097</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=916" rel="nofollow">BringerOD</a><br /><strong>Subject:</strong> 2298<br /><strong>Posted:</strong> 12-Nov-2010 at 2:05pm<br /><br /><P style="LINE-HEIGHT: normal; MARGIN: 0in 1.5pt 0.75pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN>Thanks for the reply. That makes sense. <?: prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN>&nbsp;<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN>Unfortunately, this does not fit what I need to do.<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN>I only need to stop validation for this function only.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Meaning I want server and client side validation for this entity and all entities except during this BATCH operation. <o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN>This is because there could be some legacy data that is not valid in the current database.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>When I save the batch procedure it will try and validate the invalid data, where I don’t want to at this time.<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.75pt 1.5pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: black; FONT-SIZE: 9pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-: EN" lang=EN>Hope this makes sense.<o:p></o:p></SPAN></P><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 12 Nov 2010 14:05:54 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2298&amp;PID=9097#9097</guid>
  </item> 
  <item>
   <title>Can&#039;t seem to stop the verification engine. : Your support form request provided...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2298&amp;PID=9094#9094</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 2298<br /><strong>Posted:</strong> 12-Nov-2010 at 12:00pm<br /><br />Your support form request provided the important clue - where you said that the SaveChanges() call throws the error.<DIV>&nbsp;</DIV><DIV>DevForce will by default do "server-side" validation.&nbsp;&nbsp; This validation uses a separate VerifierEngine that the one used client side, even in a 2-tier application.&nbsp; So, while you've turned off client-side validation, server-side&nbsp;validation is still running.</DIV><DIV>&nbsp;</DIV><DIV>To turn off validation on the server you'll need to implement a custom EntityServerSaveInterceptor and either override the ValidateSave method or disable the VerifierEngine available on the interceptor.&nbsp; If you disable the engine here you'll be disabling all server-side validation in your application since this VerififerEngine is shared across all client requests; so be careful,&nbsp;in an n-tier application this is a security vulnerability.&nbsp; The best approach is to turn off validation in the ValidateSave on a more granular level, for example for specific entity instances or entity types.</DIV>]]>
   </description>
   <pubDate>Fri, 12 Nov 2010 12:00:58 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2298&amp;PID=9094#9094</guid>
  </item> 
  <item>
   <title>Can&#039;t seem to stop the verification engine. : Can&amp;#039;t seem to stop the verification...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2298&amp;PID=9077#9077</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=916" rel="nofollow">BringerOD</a><br /><strong>Subject:</strong> 2298<br /><strong>Posted:</strong> 11-Nov-2010 at 11:11am<br /><br />Can't seem to stop the verification engine.&nbsp; I am doing a batch procedure that needs to ignore validation.<DIV>&nbsp;</DIV><DIV>Any idea where I am going wrong</DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> leadIdToTest = </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>new</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Guid</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>(</FONT></FONT><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas>"a7579944-fd68-4f87-875d-01cc15ba6662"</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>);</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> entities = </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>PrimeSystem</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.CreatePrimeEntities();</P><P>entities.VerifierEngine.Enabled = </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>false</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>;</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> lead = entities.Leads.Where(x =&gt; x.LeadId == leadIdToTest).SingleOrDefault();</P><P>lead.EntityAspect.VerifierEngine.Enabled = </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>false</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>;</P><P>lead.LastName += </FONT></FONT><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas><FONT color=#a31515 size=2 face=C&#111;nsolas>"1"</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>;</P><P></P><P>entities.SaveChanges();</P><P>entities.VerifierEngine.Enabled = </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>true</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>;</P></FONT></FONT></DIV>]]>
   </description>
   <pubDate>Thu, 11 Nov 2010 11:11:26 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2298&amp;PID=9077#9077</guid>
  </item> 
 </channel>
</rss>