Commit c49b19d2 authored by smanohar's avatar smanohar

All commit in between commented and kept in main method considering local...

All commit in between commented and kept in main method considering local connection, also finally added in workflow call and comitted  locally in that call

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@217267 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bf1206ba
......@@ -86,7 +86,7 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
ResultSet rs = null,rs1=null;
int cnt = 0,count=0;
ITMDBAccessEJB itmDBAccessLocal = new ITMDBAccessEJB();
boolean isLocalConnection = false; // 28-feb-2020 manoharan to take care off local commit
try
{
//ConnDriver connDriver = null;
......@@ -100,6 +100,7 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
{
conn = getConnection();
conn.setAutoCommit(false);
isLocalConnection = true;
}
//Changes and Commented By Bhushan on 09-06-2016 :END
System.out.println("PorderConf CONFIRM called xtraParams[" + xtraParams+ "]");
......@@ -223,7 +224,10 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
}
else
{
conn.commit();
if (isLocalConnection) // 28-feb-2020 manoharan to consider local connection (isLocalConnection)
{
conn.commit();
}
errString = itmDBAccessLocal.getErrorString("", "VTCNFSUCC", "","",conn);
}
}
......@@ -249,8 +253,10 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
System.out.println( ">>>>>>>>>>>>>In finaly errString:"+errString);
if (errString != null && errString.trim().length() > 0 && !("d".equalsIgnoreCase(errString)))
{
conn.rollback();
if (isLocalConnection)// 28-feb-2020 manoharan to consider local connection (isLocalConnection)
{
conn.rollback();
}
System.out.println("Transaction rollback... ");
conn.close();
conn = null;
......@@ -264,8 +270,11 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
}
}
else
{
conn.commit();
{
if (isLocalConnection)// 28-feb-2020 manoharan to consider local connection (isLocalConnection)
{
conn.commit();
}
System.out.println("@@@@ Transaction commit... ");
conn.close();
conn = null;
......@@ -327,8 +336,37 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
catch(Exception e)
{
System.out.println("Exception in [IndentReqConf] confirm " + e.getMessage());
retString = "ERROR";
throw new ITMException(e);
}
finally
{
try
{
System.out.println( ">>>>>>>>>>>>>In finaly errString:"+retString);
if (retString != null && retString.trim().length() > 0 && !("d".equalsIgnoreCase(retString)))
{
// 28-feb-2020 manoharan to consider local connection (isLocalConnection)
conn.rollback();
System.out.println("Transaction rollback... ");
conn.close();
conn = null;
}
else
{
conn.commit();
System.out.println("@@@@ Transaction commit... ");
conn.close();
conn = null;
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
return retString;
}
......@@ -500,10 +538,10 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
errString = itmDBAccessLocal.getErrorString("", "VTPOUPD", "","",conn);
return errString;
}
if(updCnt == 1)
/*if(updCnt == 1) //
{
conn.commit();
}
}*/
}
System.out.println("pordType>>["+pordType + "]errString" +errString);
if((!"P".equalsIgnoreCase(pordType)) && (errString == null || errString.trim().length() == 0))
......@@ -689,9 +727,9 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
rs.close();rs = null;
pstmt.close();pstmt = null;
//added by nandkumar gadkari------end----08/03/19
conn.commit();
isError = true;
// 28-feb-2020 manoharan not to commit locally
//conn.commit();
//isError = true;
}
}
}
......@@ -834,9 +872,9 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
rs.close();rs = null;
pstmt.close();pstmt = null;
//added by nandkumar gadkari------end----08/03/19
conn.commit();
isError = true;
// 28-feb-2020 manoharan not to commit locally
// conn.commit();
// isError = true;
}
}
}
......@@ -1031,7 +1069,7 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
pstmt.close();pstmt = null;
//added by nandkumar gadkari------end----08/03/19
conn.commit();
//conn.commit(); // 28-feb-2020 manoharan not to commit in all methods
//isError = true;
}
}
......
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