Commit bdc4e568 authored by cpatil's avatar cpatil

connection rollback if no row in detail inserted


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93933 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 23a5af7e
......@@ -915,6 +915,7 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
// test start 06/09/13
String stkOpt="";
sql = "SELECT STK_OPT FROM ITEM WHERE ITEM_CODE = ? ";
System.out.println("sql :"+sql);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
rs = pstmt.executeQuery();
......@@ -1057,7 +1058,7 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
{
pstmt.executeBatch();
pstmt.clearBatch();
System.out.println("Record inserted into detail");
System.out.println("Record inserted into detail:: count["+batchLoadCnt+"]");
if( pstmt != null )
{
pstmt.close();
......@@ -1065,20 +1066,28 @@ public class WOIssueReplacementPrc extends ProcessEJB implements GenerateReceipt
}
}
else if( batchLoadCnt == 0)
{
System.out.println("@@@@@@ no detail record inserted ["+batchLoadCnt+"]");
retStr = itmDBAccessLocal.getErrorString("","VTPROUNSU9","");
}
}
else
{
System.out.println("@@@@@ diffReplaceQty is null ");
retStr = itmDBAccessLocal.getErrorString("","VTPROUNSU9","");
}
System.out.println("@@@@ errString :::["+ retStr+"]" );
if (retStr != null && retStr.trim().length() > 0)
{
System.out.println("@@@@@@ connection rollback...............");
conn.rollback();
return retStr;
}
else
{
System.out.println("@@@@@@ connection commit...............");
conn.commit(); //commit to transaction
retStr = itmDBAccessLocal.getErrorString("","VPSUCC1","");
}
......
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