Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 864d1c3c3cd8df4e3a2692faf8776e05 > files > 250

db4o-doc-7.4-2.fc13.i686.rpm

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Remote Execution Through Evaluation API</title>
    <link rel="stylesheet" type="text/css" href="../../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>Remote Execution Through Evaluation API</h1><script>
//We attach this function to a browser object as a variable so that if multiple of these blocks are
//present on the same page, then they will simply over-write eachother with the same function instead
//of generating a naming collision.
window.WikiCodeFormattingCopyToClipboard = function copyToClipboard(sID){
	var sContent = document.getElementById(sID).innerText;
	if( window.clipboardData && clipboardData.setData )
	{
		clipboardData.setData("Text", sContent);
	}
	else
	{
		alert("You must enable javascript access to your clipboard for this feature to work. Please referr to your browser documentation or Google search for instructions.");
	}
}
</script>

<p>One of the ways to do that is using evaluation API. Evaluation/candidate classes are serialized and sent to the server. That means that if we will put the selection criteria and update code inside evaluation class, we will have that code on the server and executing a query using evaluation on the client side will run the update code on the server side.</p>
<p>For easier query execution we can use database singleton - a class that have only one instance saved in the database. That actually can be the class calling the query itself.</p>
<p>Let's fill up our server database:</p>

<span name="cs_wiki_filter" csw_filters="cs">
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">RemoteExample.cs: <span class="fscMemberName">SetObjects</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> SetObjects()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_35_333_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_35_333_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_35_333_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_35_333_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_35_333_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_35_333_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_35_333_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_35_333_Open_Text').style.display='inline';"/>    </span><span id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_35_333_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_35_333_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      File.Delete(Db4oFileName);
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IObjectContainer db </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenFile(Db4oFileName);
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      </span><span style="color: #0000FF;">try</span><span style="color: #000000;"> 
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_139_274_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_139_274_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_139_274_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_139_274_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_139_274_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_139_274_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_139_274_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_139_274_Open_Text').style.display='inline';"/>      </span><span id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_139_274_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_139_274_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">for</span><span style="color: #000000;"> (</span><span style="color: #0000FF;">int</span><span style="color: #000000;"> i </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">; i </span><span style="color: #000000;">&lt;</span><span style="color: #000000;"> </span><span style="color: #800080;">5</span><span style="color: #000000;">; i</span><span style="color: #000000;">++</span><span style="color: #000000;">) 
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_178_236_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_178_236_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_178_236_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_178_236_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_178_236_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_178_236_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_178_236_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_178_236_Open_Text').style.display='inline';"/>        </span><span id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_178_236_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_178_236_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>          Car car </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Car(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">car</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">+</span><span style="color: #000000;">i);
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>          db.Set(car);
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>        }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        db.Set(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> RemoteExample());
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>      }</span></span><span style="color: #000000;"> 
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      </span><span style="color: #0000FF;">finally</span><span style="color: #000000;"> 
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_291_313_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_291_313_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_291_313_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_291_313_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_291_313_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_291_313_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_291_313_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_291_313_Open_Text').style.display='inline';"/>      </span><span id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_291_313_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteCS.ZipsRemoteExample.Cs_RemoteExample.Cs_SetObjects_642_54_291_313_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        db.Close();
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>      }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      CheckCars();
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div>
</span>
<span name="cs_wiki_filter" csw_filters="vb">
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">RemoteExample.vb: <span class="fscMemberName">SetObjects</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteVB.ZipsRemoteExample.Vb_RemoteExample.Vb_SetObjects_754_54"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteVB.ZipsRemoteExample.Vb_RemoteExample.Vb_SetObjects_754_54_15_511_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteVB.ZipsRemoteExample.Vb_RemoteExample.Vb_SetObjects_754_54_15_511_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteVB.ZipsRemoteExample.Vb_RemoteExample.Vb_SetObjects_754_54_15_511_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteVB.ZipsRemoteExample.Vb_RemoteExample.Vb_SetObjects_754_54_15_511_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteVB.ZipsRemoteExample.Vb_RemoteExample.Vb_SetObjects_754_54_15_511_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteVB.ZipsRemoteExample.Vb_RemoteExample.Vb_SetObjects_754_54_15_511_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteVB.ZipsRemoteExample.Vb_RemoteExample.Vb_SetObjects_754_54_15_511_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteVB.ZipsRemoteExample.Vb_RemoteExample.Vb_SetObjects_754_54_15_511_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteVB.ZipsRemoteExample.Vb_RemoteExample.Vb_SetObjects_754_54_15_511_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub SetObjects()</span><span id="ResourcesReferenceClient-ServerRemote_Code_ExecutionremoteVB.ZipsRemoteExample.Vb_RemoteExample.Vb_SetObjects_754_54_15_511_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> SetObjects()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            File.Delete(Db4oFileName)
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenFile(Db4oFileName)
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Try</span><span style="color: #000000;">
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> i </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Integer</span><span style="color: #000000;">
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">For</span><span style="color: #000000;"> i </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;"> </span><span style="color: #0000FF;">To</span><span style="color: #000000;"> </span><span style="color: #800080;">5</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;"> </span><span style="color: #800080;">1</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Step</span><span style="color: #000000;"> i </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800080;">1</span><span style="color: #000000;">
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> car </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Car </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Car(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">car</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> i.ToString())
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    db.Set(car)
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Next</span><span style="color: #000000;">
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db.Set(</span><span style="color: #0000FF;">New</span><span style="color: #000000;"> RemoteExample())
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Finally</span><span style="color: #000000;">
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db.Close()
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;">
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            CheckCars()
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div>
<p>[/filter] </p>
<p>Now we can update the cars using specially designed singleton:</p>
<p> </p>
<p>This method has its pros and cons.</p>
<p>Pros:</p>
<ul>
<li>any arbitrary code can be executed;</li>
<li>the code is executed on the server side;</li>
</ul>
<p>Cons:</p>
<ul>
<li>the code will have to be serialized and sent over a network connection;</li>
<li>changing the code will require update of all clients</li>
</ul></div>
    </div>
    <div id="footer">
					This revision (5) was last Modified 2006-11-14T11:50:58 by Tetyana.
				</div>
  </body>
</html>