I am usigng the following code on client side to update a treegrid record.
and on the action side i have the following code:
I am getting an exception when the code executes
objRPC.send(dsRequest,dsResponse);
Is there anything wrong with this ?
I am not getting this error when i do a fetch operation.
Code:
StoreDetails_TreeGrid.updateData(StoreDetails_TreeGrid.getSelectedRecord(), "fnUpdateLocnTableCB(dsResponse,data,dsRequest)",null);
Code:
public String saveDetails() throws Exception {
DSRequest dsRequest = null;
DSResponse dsResponse = new DSResponse();
RPCManager objRpc = null;
Map<String, String> mpErrorResponseData =
new HashMap<String, String>();
MasterObjectLocation objMasterObjectLocn =
new MasterObjectLocation();
List<MasterObjectLocation> lstMasterObjectLocn =
new ArrayList<MasterObjectLocation>();
try {
objRpc = getRPCObject();
logger.debug("inside searchStoreCluster");
rpc = getRPCObject();
String strLocn = null;
PromoAdLocnService objPromoAdLocnServiceSLSB =
getPromoAdLocnService();
for (Iterator<?> i = rpc.getRequests().iterator(); i.hasNext();) {
Object req = i.next();
dsRequest = (DSRequest) req;
String dsName = dsRequest.getDataSourceName();
dsResponse.setSuccess();
logger.debug("Criterias" + dsRequest.getCriteria());
if ((dsRequest.getCriteria() != null)
|| (dsRequest.getCriteria().size() != 0)) {
String operation = dsRequest.getOperationType();
logger.debug("operation " + operation);
List<MasterObjectLocation> lstMstAdvLoc = new ArrayList<MasterObjectLocation>();
Map<String,Object> mpNewValuesAdLocn = dsRequest.getValues();
logger.debug("Old Values"+dsRequest.getOldValueSets());
Map<String,Object> mpOldValuesAdLocn = dsRequest.getOldValues();
MasterObjectLocation MstAdvLoc = new MasterObjectLocation();
MasterObjectLocationPK objMstAdLocationPK =
new MasterObjectLocationPK();
Object dtEffDate = mpOldValuesAdLocn.get("dtEffDate");
if( dtEffDate instanceof java.util.Date){
objMstAdLocationPK.setDtEffectiveDate(new java.sql.Date(((java.util.Date)dtEffDate).getTime()));
}else{
objMstAdLocationPK.setDtEffectiveDate(PromoWebUtils.convertStringToSqlDate(dtEffDate.toString()));
}
strLocn = (String) mpOldValuesAdLocn.get("iLocnNumber");
objMstAdLocationPK.setSLocnNumber(Short.valueOf(strLocn));
MstAdvLoc.setObjMasterObjectLocnPK(objMstAdLocationPK);
lstMstAdvLoc.add(MstAdvLoc);
for (MasterObjectLocation MasterObjectLocation
: lstMstAdvLoc) {
logger.debug("loc: "
+ MasterObjectLocation
.getObjMasterObjectLocnPK()
.getSLocnNumber());
}
PromoAdLocnService promoAdLocnServiceSLSB =
getPromoAdLocnService();
promoAdLocnServiceSLSB.saveAdLocnDetails(lstMstAdvLoc);
}
}
} catch (PromoFailureException fe) {
mpErrorResponseData.put(PromoExceptionConstants.TYP_ERR_MSG,
PromoErrorMessage.buildErrorMessage(fe
.getPromoErrorMessage()));
dsResponse.setData(mpErrorResponseData);
dsResponse.setStatus(RPCResponse.STATUS_FAILURE);
} catch (Throwable t) {
mpErrorResponseData.put("someKey","somemessage");
dsResponse.setData(mpErrorResponseData);
dsResponse.setStatus(RPCResponse.STATUS_FAILURE);
}
try{
objRpc.send(dsRequest, dsResponse); ///This line thrrows error
/*
java.lang.Exception: No response for request: com.isomorphic.datasource.DSRequest@1d9a1d9a
at com.isomorphic.rpc.RPCManager.completeResponse(RPCManager.java:837)
at com.isomorphic.rpc.RPCManager.send(RPCManager.java:494)
at com.shc.impact.promo.ui.market.action.PromoAdLocnAction.saveAdLocnDetails(PromoAdLocnAction.java:4538)
.......
......
*/
}catch(Exception ex){
ex.printStackTrace();
}
return null;
}
objRPC.send(dsRequest,dsResponse);
Is there anything wrong with this ?
I am not getting this error when i do a fetch operation.
Comment