on 10-20-2011 2:47 PM
Hello Experts,
I am trying to update the status of a BOM with the following code.
But get an error in the logs that says "Record updated by another user (Message 10006)"
My code is as follows:
public String statusUpdate(String bom, String revision, String site, String newStatus,String bomType) {
// TODO Auto-generated method stub
DateGlobalizationServiceInterface dateService
= (DateGlobalizationServiceInterface) GlobalizationService.getInvariantService(KnownGlobalizationServices.DATE);
DateTimeInterface nowTimeStamp = dateService.createDateTime();
Data msgData = new Data();
msgData.put("SITE", site);
msgData.put("BOM", bom);
msgData.put("REVISION",revision);
msgData.put("STATUS_BO",newStatus);
msgData.put("MODIFIED_DATE_TIME",nowTimeStamp);
msgData.put("BOM_TYPE", bomType);
BOMBOInterface bomBean = (BOMBOInterface) ServiceLocator.getService("BOMBO");
try{
bomBean.dbUpdate(msgData);
}catch (BasicBOBeanException e){
e.printStackTrace();
Utils.logAppServerMsg(Utils.getStackTrace(), 1);
return Utils.getStackTrace();
}
return "ok";
}
Hello,
To perform "update" of object you need to first read it and make sure to use correct modified date time of object that you read.
Thanks,
Bakhtiyar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.