Commit 919b81bb authored by arawankar's avatar arawankar

PayablesOpeningConf.java

-Changes made related to rollback transaction in case of error
-To return proper error message in case of error


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@191013 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4184e017
......@@ -348,6 +348,16 @@ conn = getConnection();
catch(Exception e)
{
System.out.println("Exception [11][confirmPayablesOpening][Excuting Query Failed]" + sqlIns + e.getMessage());
//Modified by Anjali R. on[20/09/2018][Start]
try
{
conn.rollback();
}
catch(Exception e1)
{
System.out.println("Exception In Rollback Transaction--["+e1.getMessage()+"]");
}
//Modified by Anjali R. on[20/09/2018][End]
e.printStackTrace();
retString = e.getMessage();
return retString;
......@@ -446,6 +456,16 @@ conn = getConnection();
catch(Exception e)
{
System.out.println("Exception [11][confirmPayablesOpening][Excuting Query Failed]" + sqlUpd + e.getMessage());
//Modified by Anjali R. on[20/09/2018][Start]
try
{
conn.rollback();
}
catch(Exception e1)
{
System.out.println("Exception In Rollback Transaction--["+e1.getMessage()+"]");
}
//Modified by Anjali R. on[20/09/2018][End]
e.printStackTrace();
retString = e.getMessage();
return retString;
......@@ -560,9 +580,14 @@ conn = getConnection();
ls_errcode = finCommon.sundrybalOpnUpd(sundrybalMap,conn);//Gulzar 04-12-06
sundrybalMap.clear();//Gulzar 04-12-06
System.out.println("Error Code........"+ls_errcode);
if(ls_errcode.trim().length()>0)
//Modified by Anjali R. on [20/09/2018][To return proper error message][Start]
//if(ls_errcode.trim().length()>0)
if(ls_errcode != null && ls_errcode.trim().length()>0)
{
retString = itmDBAccessEJB.getErrorString("", "ls_errcode", userId);
//retString = itmDBAccessEJB.getErrorString("", "ls_errcode", userId);
retString = itmDBAccessEJB.getErrorString("", ls_errcode, userId);
//Modified by Anjali R. on [20/09/2018][To return proper error message][End]
break;
}
System.out.println("RETURN FROM SUNDRYBAL ENTRIES");
......@@ -587,8 +612,13 @@ conn = getConnection();
//ls_errcode2 = finCommon.gbf_acctbal_upd(acctbalMap,conn); //Gulzar 04-12-06
ls_errcode2 = finCommon.acctbalOpnUpd(acctbalMap,conn);//Gulzar 04-12-06
acctbalMap.clear(); //Gulzar 04-12-06
if(ls_errcode2.trim().length()>0)
//Modified by Anjali R. on [20/09/2018][To return proper error message][Start]
//if(ls_errcode2.trim().length()>0)
if(ls_errcode2 != null && ls_errcode2.trim().length()>0)
{
retString = itmDBAccessEJB.getErrorString("", ls_errcode2, userId);
//Modified by Anjali R. on [20/09/2018][To return proper error message][End]
break;
}
System.out.println("RETURN FROM ACCTBAL ENTRIES");
......@@ -600,6 +630,10 @@ conn = getConnection();
pstmt2 = null;
try
{
//Modified by Anjali R. on[20/09/2018][If return string is empty then only confirmed value set to be "Y"][Start]
if(retString == null || retString.trim().length() == 0)
{
//Modified by Anjali R. on[20/09/2018][If return string is empty then only confirmed value set to be "Y"][End]
System.out.println("emp code:="+empCode);
update = "UPDATE PAYABLES_HDR SET CONFIRMED = 'Y', CONF_DATE = ? ,EMP_CODE__APRV = ? where TRAN_ID = ?";
//System.out.println("Confirm update SQL ::"+ update);
......@@ -621,7 +655,16 @@ conn = getConnection();
else
{
System.out.println("PAYABLES_HDR Not Updated...(Not Confirmed)");
conn.rollback();//Modified by Anjali R. on[20/09/2018][To rollback in case of any error]
}
//Modified by Anjali R. on[20/09/2018][To rollback in case of any error][Start]
}
else
{
System.out.println("return string ---["+retString+"]");
conn.rollback();
}
//Modified by Anjali R. on[20/09/2018][To rollback in case of any error][End]
}
catch(SQLException se)
{
......@@ -666,6 +709,16 @@ conn = getConnection();
catch(SQLException se)
{
System.out.println("SQLException []:[PayablesOpeningConfEJB][Excuting Query Failed]" + sqlDtl + se.getMessage());
//Modified by Anjali R. on[20/09/2018][In case of exception,rollback the entire transaction][Start]
try
{
conn.rollback();
}
catch(Exception e)
{
System.out.println("Exception --["+ e.getMessage()+"]");
}
//Modified by Anjali R. on[20/09/2018][In case of exception,rollback the entire transaction][End]
se.printStackTrace();
}
catch(Exception ex1)
......
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