Commit b8a7ddf1 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@105627 ce508802-f39f-4f6c-b175-0d175dae99d5
parent cadcb615
......@@ -424,27 +424,45 @@ public class SalesReturnConfirm extends ActionHandlerEJB implements SalesReturnC
isError = true;
e.printStackTrace();
}
finally {
System.out.println("in finally--------->>" + isError);
try {
if (isError) {
finally
{
System.out.println("Inside Finally ["+isError+"] ErrorCode ["+ls_errcode+"]");
try
{
//Changed by wasim on 17-05-2017 to check the error code [START]
/*if (isError)//VTSRTRNCMP
{
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();
}
if (rs != null) {
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null) {
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (conn != null) {
if (conn != null)
{
conn.close();
conn = null;
}
} catch (SQLException e) {
}
catch (SQLException e)
{
// TODO Auto-generated catch block
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