There are two types of conflicts detected by LCDS - those detected on the server when you try to update with stale data, and those detected on the client when you have uncommitted changes to an item which receives a pushed change.
For the server detected conflicts, it is up to the assembler to determine when a conflict has occurred for a given update. Some assemblers like the hibernate assembler have an option you can set to choose "object" versus "property" level detection. An object level conflict detection would trigger a conflict if any change had been made to that object since the client fetched its version. A property level conflict is generated only when the property changed by the client has been changed on the server. Check the source for the hibernate assembler if you are interested in more details on how to implement that on the server. For the client detected conflicts, unfortunately right now we only implement "property" level conflict detection out of the box. You can supply your own "ConflictDetector" implementation though by setting the DataService.conflictDetector property to an instance of a class you write which extends ConflictDetector. When your checkUpdate method is called, you can signal a conflict whenever there is a local change to the item being updated on the server. You would extend conflictDetectory and override your checkUpdate method something like this: override public function checkUpdate(remoteChange:IChangeObject, localChange:IChangeObject):void { var changes:Array = remoteChange.changedPropertyNames; var conflictingProps:Array = null; if (localChange != null) { var currentVersion:Object = localChange.currentVersion; if (localChange.isUpdate()) { remoteChange.conflict("Local item has changes to properties that conflict with remote change.", changes); } } super.checkUpdate(remoteChange, localChange); } Jeff ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Maciek Sakrejda Sent: Tuesday, April 29, 2008 8:24 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] How to choose data generating conflict withLiveCycle Data Services ? Well, the immediate thing that comes to mind is track a hash of "first name + last name", and update this if either changes. Not the cleanest solution, but it should solve your problem (assuming you have control over the schema of the persisted employee objects). -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com <http://www.truviso.com> -----Original Message----- From: Mathieu Fernandez <[EMAIL PROTECTED] <mailto:mathieu.fernandez%40keepcore.com> > Reply-To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> Subject: [flexcoders] How to choose data generating conflict with LiveCycle Data Services ? Date: Tue, 29 Apr 2008 09:41:41 +0200 Hi everybody, I made a little prototype handling conflicts with LCDS. I've got a web AIR application which contains a grid (each line represents an employee) with 3 columns (ID, firstname, lastname) and a frrame on the top right which contains the firstname and the lastname of the line selected (we can modify those name and save). When I modify the same data on 2 differents browser for example, I've got a data conflict and I display a screen allowing the user to choose between the server version and the client version (a litle bit like this video : http://blog.phiphou.com/index.php/?2008/01/25/107-livecycle-data-service s-gestion-de-conflits <http://blog.phiphou.com/index.php/?2008/01/25/107-livecycle-data-servic es-gestion-de-conflits> ). The problem : In a line of my datagrid I've got an employee, his firstname is "Lionel" and his lastname is "Messi". A conflict is generated when I modify the same data at the time in 2 browser (for example I modify the lastname in the 2 browser). I would like LCDS generates a conflict when I modify the firstname in a browser and the lastname in another browser at the same time (for the moment, when I do this, the 2 operations succeed and the lastname and the firstname are changed whereas I would like to generate a conflict). How can I do ? I tried manyu things but I can't find an answer. Thanks for all.