Commit b524f103 authored by ssalve's avatar ssalve

Sarita: Done changes to add new method commit on 19MARCH2018

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@182297 ce508802-f39f-4f6c-b175-0d175dae99d5
parent cf63045b
...@@ -38,12 +38,69 @@ public class AdjIssueRcpConf extends ActionHandlerEJB implements AdjIssueRcpConf ...@@ -38,12 +38,69 @@ public class AdjIssueRcpConf extends ActionHandlerEJB implements AdjIssueRcpConf
E12GenericUtility genericUtility= new E12GenericUtility(); E12GenericUtility genericUtility= new E12GenericUtility();
FinCommon finCommon = new FinCommon(); FinCommon finCommon = new FinCommon();
DistCommon disCommon= new DistCommon(); DistCommon disCommon= new DistCommon();
//Added Method By Sarita on 19MARCH2018 [start]
public String confirm(String tranId, String xtraParams, String forcedFlag)throws RemoteException, ITMException public String confirm(String tranId, String xtraParams, String forcedFlag)throws RemoteException, ITMException
{
System.out.println("Inside Confirm Method of Connection!!!!!!!!");
String errString = "";
boolean isError = false;
Connection conn = null;
try
{
ConnDriver connDriver = null;
connDriver = new ConnDriver();
conn = getConnection();
conn.setAutoCommit(false);
errString = confirm(tranId, xtraParams,forcedFlag,conn);
System.out.println("errString[confirm] is ["+errString+"]");
if(errString != null && !(errString.indexOf("VTMCONF2") > -1))
{
isError = true;
}
}
catch(Exception e)
{
System.out.println("Exception [AdjIssueRcpConf]"+e);
e.printStackTrace();
isError = true;
throw new ITMException(e);
}
finally
{
try
{
if(isError)
{
conn.rollback();
System.out.println("SRLContainerSplit connection rollback");
}
else
{
conn.commit();
System.out.println("SRLContainerSplit connection committed");
}
if(conn != null)
{
conn.close();
conn = null;
}
}
catch(Exception e)
{
System.out.println("Exception : "+e);e.printStackTrace();
throw new ITMException(e);
}
}
return errString;
}
//Added Method By Sarita on 19MARCH2018 [start]
public String confirm(String tranId, String xtraParams, String forcedFlag,Connection conn)throws RemoteException, ITMException
{ {
System.out.println(">>>>>>>>>>>>>>>>>>AdjIssueRcpConf and receipt Conf confirm called>>>>>>>>>>>>>>>>>>>"); System.out.println(">>>>>>>>>>>>>>>>>>AdjIssueRcpConf and receipt Conf confirm called>>>>>>>>>>>>>>>>>>>");
String confirmed = "",runMode=""; String confirmed = "",runMode="";
String sql = ""; String sql = "";
Connection conn = null; //Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
String errString = null; String errString = null;
String refSer = "",winName= ""; String refSer = "",winName= "";
...@@ -54,13 +111,15 @@ public class AdjIssueRcpConf extends ActionHandlerEJB implements AdjIssueRcpConf ...@@ -54,13 +111,15 @@ public class AdjIssueRcpConf extends ActionHandlerEJB implements AdjIssueRcpConf
E12GenericUtility genericUtility= new E12GenericUtility(); E12GenericUtility genericUtility= new E12GenericUtility();
try try
{ {
ConnDriver connDriver = null; //Commented by sarita on 19MARCH2018 [start]
/*ConnDriver connDriver = null;
connDriver = new ConnDriver(); connDriver = new ConnDriver();
//Changes and Commented By Bhushan on 09-06-2016 :START //Changes and Commented By Bhushan on 09-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM"); //conn = connDriver.getConnectDB("DriverITM");
conn = getConnection(); conn = getConnection();
//Changes and Commented By Bhushan on 09-06-2016 :END //Changes and Commented By Bhushan on 09-06-2016 :END
conn.setAutoCommit(false); conn.setAutoCommit(false);*/
//Commented by sarita on 19MARCH2018 [end]
runMode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "runMode"); runMode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "runMode");
System.out.println("runMode["+runMode+"]"); System.out.println("runMode["+runMode+"]");
if (tranId != null && tranId.trim().length() > 0) if (tranId != null && tranId.trim().length() > 0)
...@@ -101,7 +160,7 @@ public class AdjIssueRcpConf extends ActionHandlerEJB implements AdjIssueRcpConf ...@@ -101,7 +160,7 @@ public class AdjIssueRcpConf extends ActionHandlerEJB implements AdjIssueRcpConf
{ {
cnt = rs.getInt(1); cnt = rs.getInt(1);
} }
System.out.println("confirmed>>>>>>>>"+confirmed); System.out.println("confirmed>>>>>>>>cnt is "+cnt);
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
...@@ -113,9 +172,11 @@ public class AdjIssueRcpConf extends ActionHandlerEJB implements AdjIssueRcpConf ...@@ -113,9 +172,11 @@ public class AdjIssueRcpConf extends ActionHandlerEJB implements AdjIssueRcpConf
System.out.println("retrieveAdjissrcp>>>"+errString); System.out.println("retrieveAdjissrcp>>>"+errString);
if (errString == null || errString.trim().length() == 0) if (errString == null || errString.trim().length() == 0)
{ {
conn.commit(); //Commented by sarita on 19MARCH2018
//conn.commit();
errString = itmDBAccessLocal.getErrorString("", "VTMCONF2", ""); errString = itmDBAccessLocal.getErrorString("", "VTMCONF2", "");
}else }
else
{ {
conn.rollback(); conn.rollback();
} }
...@@ -124,9 +185,10 @@ public class AdjIssueRcpConf extends ActionHandlerEJB implements AdjIssueRcpConf ...@@ -124,9 +185,10 @@ public class AdjIssueRcpConf extends ActionHandlerEJB implements AdjIssueRcpConf
} }
} catch (Exception e) } catch (Exception e)
{ {
if(conn!=null) if(conn!=null)
{ {
try { try {
conn.rollback(); conn.rollback();
} catch (SQLException ex) { } catch (SQLException ex) {
...@@ -141,11 +203,13 @@ public class AdjIssueRcpConf extends ActionHandlerEJB implements AdjIssueRcpConf ...@@ -141,11 +203,13 @@ public class AdjIssueRcpConf extends ActionHandlerEJB implements AdjIssueRcpConf
{ {
try try
{ {
if(conn != null) //Commented by sarita on 19MARCH2018[start]
/*if(conn != null)
{ {
conn.close(); conn.close();
conn = null; conn = null;
} }*/
//Commented by sarita on 19MARCH2018[end]
if(rs != null) if(rs != null)
{ {
rs.close(); rs.close();
......
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