Commit c63b07b8 authored by caluka's avatar caluka

deleted from mps_order when any exception occured in export data


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101330 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ef19ca8c
...@@ -29,7 +29,7 @@ public class RequirementIC extends ValidatorEJB implements RequirementICLocal, R ...@@ -29,7 +29,7 @@ public class RequirementIC extends ValidatorEJB implements RequirementICLocal, R
E12GenericUtility genericUtility= new E12GenericUtility(); E12GenericUtility genericUtility= new E12GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
SimpleDateFormat simpleDateFormat = null; SimpleDateFormat simpleDateFormat = null;
String tranIdStr = "'";
public String wfValData() throws RemoteException, ITMException public String wfValData() throws RemoteException, ITMException
{ {
System.out.println("wfValData()..."); System.out.println("wfValData()...");
...@@ -719,13 +719,29 @@ public class RequirementIC extends ValidatorEJB implements RequirementICLocal, R ...@@ -719,13 +719,29 @@ public class RequirementIC extends ValidatorEJB implements RequirementICLocal, R
System.out.println("parentNode["+parentNode+"]"); System.out.println("parentNode["+parentNode+"]");
winName = this.getWinName(parentNode); winName = this.getWinName(parentNode);
System.out.println("winName["+winName+"]"); System.out.println("winName["+winName+"]");
tranIdStr = "'";
if (tranIdList != null && tranIdList.size() > 0)
{
for (int i = 0; i < tranIdList.size(); i++)
{
tranIdStr = tranIdStr + tranIdList.get(i) + "','";
}
}
if (tranIdStr.length() >= 2)
{
tranIdStr = tranIdStr.substring(0, tranIdStr.length() - 2);
} else
{
tranIdStr = "";
}
mrpGetData = runMRPObj.getData(argDom, dom2, winName, xtraParams); mrpGetData = runMRPObj.getData(argDom, dom2, winName, xtraParams);
/* End Added by sachin */ /* End Added by sachin */
System.out.println("mrpGetData =[" + mrpGetData + "]"); System.out.println("mrpGetData =[" + mrpGetData + "]");
String tranIdStr = "'"; //String tranIdStr = "'";
/*
if (tranIdList != null && tranIdList.size() > 0) if (tranIdList != null && tranIdList.size() > 0)
{ {
for (int i = 0; i < tranIdList.size(); i++) for (int i = 0; i < tranIdList.size(); i++)
...@@ -739,7 +755,7 @@ public class RequirementIC extends ValidatorEJB implements RequirementICLocal, R ...@@ -739,7 +755,7 @@ public class RequirementIC extends ValidatorEJB implements RequirementICLocal, R
} else } else
{ {
tranIdStr = ""; tranIdStr = "";
} }*/
if (tranIdStr != null && tranIdStr.trim().length() > 0) if (tranIdStr != null && tranIdStr.trim().length() > 0)
{ {
...@@ -773,6 +789,7 @@ public class RequirementIC extends ValidatorEJB implements RequirementICLocal, R ...@@ -773,6 +789,7 @@ public class RequirementIC extends ValidatorEJB implements RequirementICLocal, R
{ {
try try
{ {
if (conn != null) if (conn != null)
{ {
if (!isError) if (!isError)
...@@ -781,6 +798,19 @@ public class RequirementIC extends ValidatorEJB implements RequirementICLocal, R ...@@ -781,6 +798,19 @@ public class RequirementIC extends ValidatorEJB implements RequirementICLocal, R
} else } else
{ {
conn.rollback(); conn.rollback();
if (tranIdStr != null && tranIdStr.trim().length() > 0)
{
deleteSql = "DELETE FROM MPS_ORDER WHERE TRAN_ID IN(" + tranIdStr + ")";
pstmt = conn.prepareStatement(deleteSql);
delCnt = pstmt.executeUpdate();
if (delCnt > 0)
{
System.out.println("Record deleted from mps_order successfully for tran id in error block =[" + tranIdStr + "]");
conn.commit();
}
pstmt.close();
pstmt = null;
}
} }
if (rs != null) if (rs != null)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment