| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
| <html xmlns="http://www.w3.org/1999/xhtml">
|
| <head>
|
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
| <link href="main.css" rel="stylesheet" type="text/css" />
|
| </head>
|
| <body>
|
| <p>
|
| It is highly suggested to first read the Basic Data Management sample readme here in Tour de Flex for an overview of
|
| Data Management Services provided by LCDS if you are not already familiar with it.
|
| </p>
|
| <p>
|
| The Data Management Service lets applications share and update distributed data in a synchronized manner. When
|
| more than one client changes the same piece of data at the same time, data synchronization conflicts can occur. The
|
| Data Management Service provides a conflict resolution API for detecting and handling data synchronization
|
| conflicts, and ensuring the integrity of distributed data by limiting further changes until conflicts are resolved.
|
| </p>
|
| <p>
|
| A Data Management Service destination is provided with the original version of the object, before the changes were
|
| applied, as well as the new version of the object after the changes. Both of these versions are maintained on the client
|
| and serialized to the server as part of each object update. If the current value of the data in the database does not
|
| match the original version, the destination may choose to raise a conflict. The conflict handler provides the current
|
| server version of the object as part of the conflict. On the client, a conflict event that has the original version, the
|
| client's changed version, and the current server version, is raised. The client can accept the client or server version
|
| and can then copy over any other properties as necessary. The amount of server-side code required to implement
|
| conflict resolution depends on the type of adapter that you use. You can write client ActionScript code to handle
|
| conflict exceptions in the manner most appropriate for your application.
|
| </p>
|
| <p>
|
| To ensure you can handle conflicts, set autoSyncEnabled to false on your DataService object so that the built-in
|
| synchronization does not occur where those changes are then automatically broadcast to all clients. You then handle the conflicts
|
| through the conflictHandler set on the client via the 'conflict' property on the DataService object. See the sample for more details.
|
| </p>
|
|
|
|
|
| <p>A list of links to the server side files used in this sample are listed below for further reference. </p>
|
| <table>
|
| <tr><td><a href="http://tourdeflex.adobe.com/remotesamples/DataAccess/server-source-code/flex/samples/product2/ProductAssembler.java.txt">ProductAssembler.java</a></td></tr>
|
| <tr><td><a href="http://tourdeflex.adobe.com/remotesamples/DataAccess/server-source-code/flex/samples/product2/Product.java.txt">Product.java</a></td></tr>
|
| <tr><td><a href="http://tourdeflex.adobe.com/remotesamples/DataAccess/server-source-code/flex/samples/product2/ProductDAO.java.txt">ProductDAO.java</a></td></tr>
|
| <tr><td><a href="http://tourdeflex.adobe.com/remotesamples/DataAccess/server-source-code/flex/samples/product2/BaseDAO.java.txt">BaseDAO.java</a></td></tr>
|
| <tr><td><a href="http://tourdeflex.adobe.com/remotesamples/DataAccess/server-source-code/flex/samples/product2/ConcurrencyException.java.txt">ConcurrencyException.java</a></td></tr>
|
|
|
| </table>
|
|
|
| </body>
|
| </html> |