Componentes.Terceros.RemObj.../internal/6.0.43.801/1/RemObjects Samples/Data Abstract for Delphi/Refresh Update Data/RefreshData.Sample.html

73 lines
3.0 KiB
HTML
Raw Permalink Normal View History

<html>
<head>
<link rel="stylesheet" type="text/css" href="..\styles.css">
</head>
<body>
<img src="..\..\da.png" alt="" align="right">
<!-------------------------------------------------------------------------->
<p class="h1">Refresh Update Data Sample</p>
<p>
This sample demonstrates how changes made to the data by one of the client applications can be instantly
propagated to other clients connected to the same server.<br/>
The following steps are performed to achieve the goal:
</p>
<ul>
<li>
When the user attempts to edit a record the client application calls the remote method of the server to notify
that the row is being edited. Row being edited by one client application will be made unavailable for edit by others to
prevent update conflicts.
</li>
<li>
When the server is informed about a row edit attempt it sends row lock notifications to all clients connected. RO SDK
<b>callback events</b> are used for this purpose. Also the server maintains the list of locked rows to lock rows on the newly connected clients.
</li>
<li>
When the client finishes editing the row it sends changed data to the server as usual and in addition calls the
remote method to inform that the row lock is released.
</li>
<li>The server notifies all clients about releasing the row lock.</li>
<li>
When row release notification is processed by the client it refetches the changed row from the server.
<b>Dynamic Where</b> is used to fetch particular row.
</li>
</ul>
<p class="h2">Examine the code</p>
<p>Examine the client:</p>
<ul>
<li>Examine <b>TClientForm.btEditClick</b> event handler to see how the record is edited.</li>
<li>
See how the client processes row lock notifications, examine <b>TClientForm.OnUpdateAllBlock</b>
and <b>TClientForm.OnUpdateBlock</b> methods.
</li>
<li>See how changed data refresh is performed, examine <b>TClientForm.OnUpdateUnblock</b> method.</li>
</ul>
<p>Examine the sample server:</p>
<ul>
<li>Examine <b>BlockRow</b> service method to see how the row edit attempt is processed.</li>
<li>Examine <b>BlockSetOfRows</b> to see how the server interacts with newly connected client.</li>
<li>Examine <b>UnblockRow</b> service method to see how the row change notification is propagated to connected clients.</li>
</ul>
<p class="h2">Getting started</p>
<ul>
<li>Run the Sample Server.</li>
<li>Run two or more instances of the RefreshData sample.</li>
<li>Load data to every client instance with Load button.</li>
<li>Click Edit button to edit the row.</li>
<li>
See how the row being edited on one client instance is marked 'locked' on others. You may try to edit the locked row,
the application will forbid doing this.
</li>
<li>Make some changes to the row being edited and confirm changes in the edit form.</li>
<li>See how row locks are relesed on the remaining client instances and how the row is updated.</li>
<li>
While the row is being edited on any client launch one more client instance. See how existing row locks are displayed
on the newly connected client.
</li>
</ul>
</body>
</html>