Commit 627440a8 authored by wansari's avatar wansari

Updated source to commit and roll back transaction in finally if any...

Updated source to commit and roll back transaction in finally if any validation occur or successfully completed the Sales return confirm transaction.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@43848 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 19ee98dd
...@@ -424,27 +424,45 @@ public class SalesReturnConfirm extends ActionHandlerEJB implements SalesReturnC ...@@ -424,27 +424,45 @@ public class SalesReturnConfirm extends ActionHandlerEJB implements SalesReturnC
isError = true; isError = true;
e.printStackTrace(); e.printStackTrace();
} }
finally { finally
System.out.println("in finally--------->>" + isError); {
try { System.out.println("Inside Finally ["+isError+"] ErrorCode ["+ls_errcode+"]");
if (isError) { try
{
//Changed by wasim on 17-05-2017 to check the error code [START]
/*if (isError)//VTSRTRNCMP
{
conn.rollback(); conn.rollback();
} else { } */
if(isError || (ls_errcode != null && ls_errcode.indexOf("VTSRTRNCMP") == -1))
{
System.out.println("Rollback Transaction.............");
conn.rollback();
}
//Changed by wasim on 17-05-2017 to check the error code [END]
else
{
System.out.println("Committed Transaction.............");
conn.commit(); conn.commit();
} }
if (rs != null) { if (rs != null)
{
rs.close(); rs.close();
rs = null; rs = null;
} }
if (pstmt != null) { if (pstmt != null)
{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if (conn != null) { if (conn != null)
{
conn.close(); conn.close();
conn = null; conn = null;
} }
} catch (SQLException e) { }
catch (SQLException e)
{
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} }
......
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