Hi All,
We are having LCDS Data management services which is using Abstract
Assembler approach . Autos sync is enabled for the service. We are
using Spring framework at java side. Situation is like this
Two clients are seeing same fill method
First client deletes one row
Second client inserts one record before sync happens
Second Client gets DataServiceFaultEvent but backend everything works
fine, data gets inserted in DB no error in assembler as well.
Assembler code is below :
public class TrackDataAssembler extends AbstractAssembler {
private DataAdminService adminService;
/**
*
* @param fillArgs
* First Arg is elementId, second arg should be
in the form of map which will be passed to dao as sqlmap parameters
* @return
*/
public Collection fill(List fillArgs) {
try{
Map argsMap = new HashMap();
argsMap.put("STLTID", fillArgs.get(0));
return new ArrayList(adminService.getTrackData
(argsMap));
}
catch(ApplicationException ex){
throw new DataSyncException(fillArgs,null);
}
}
/**
* Delete the item.
*
* @param arg0 - the item with which to perform the delete
*
* @return void
*/
public void deleteItem(Object arg0) {
DataAdminVO deletedRow = (DataAdminVO)arg0;
try{
adminService.deleteTrack(deletedRow);
}
catch(Exception ex){
throw new DataSyncException(deletedRow, null);
}
}
/**
* Updates the item.
*
* @param arg0 - the new version of the item with which to
perform the update
* @param arg1 - the original version of the item before
these changes were made (used for conflict detection).
* @param arg2 - the list of changed property names.
*
* @return void
*/
public void updateItem(Object arg0, Object arg1, List
arg2) {
DataAdminVO updatedRow = (DataAdminVO)arg0;
if (updatedRow.getNewId() != null) {
try{
adminService.updateTrack(updatedRow);
}
catch(ApplicationException ex){
throw new DataSyncException(updatedRow,
null);
}
}
}
/**
* Creates the item.
*
* @param arg0 - the initial instance of the item to
create.
*
* @return void
*/
public void createItem(Object arg0) {
DataAdminVO insertedRow = (DataAdminVO)arg0;
try{
adminService.insertTrack(insertedRow);
}
catch(ApplicationException ex){
throw new DataSyncException(insertedRow,
null);
}
}
/**
* @return Returns the adminService.
*/
public DataAdminService getAdminService() {
return adminService;
}
/**
* @param adminService The adminService to set.
*/
public void setAdminService(DataAdminService adminService)
{
this.adminService = adminService;
}
/**
* Called when a client adds an item to a filled
collection.
*
* @param arg0 - the list of parameters which identify the
fill that the client changed.
* @param arg1 - the index where a new item was added.
* @param arg2 - the identity of the item added at the
specified position.
*
* @return void
*/
public boolean autoRefreshFill(List arg0) {
return false;
}
/**
* This method can be used to help control how fill
methods are refreshed by Data Management Services.
*
* @param arg0 - Client-side parameters to a fill method
that created a managed collection still managed by one or more
clients.
*
* @return void
*/
public int refreshFill(List arg0, Object arg1, boolean
arg2) {
DataAdminVO updatedRow = (DataAdminVO)arg1;
updatedRow.setNewId(null);
return DO_NOT_EXECUTE_FILL;
}
}
Configuration is
<destination id="trackDS">
<channels>
<channel ref="my-secure-amf"/>
<channel ref="my-amf"/>
</channels>
<adapter ref="java-dao" />
<properties>
<use-transactions>false</use-transactions>
<source>trackDS</source>
<factory>spring</factory>
<metadata>
<identity property="trackId"/>
</metadata>
<network>
<session-timeout>0</session-timeout>
<paging enabled="false" pageSize="10" />
<throttle-inbound policy="ERROR" max-frequency="500"/>
<throttle-outbound policy="REPLACE" max-
frequency="500"/>
</network>
</properties>
</destination>
Hope to get any help soon.
Happy Coding,
Thanks,
Anoop
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---