Commit 736a70f6 authored by manohar's avatar manohar

unclosed connections closed


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91355 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 86104751
......@@ -98,8 +98,8 @@ public class SoHoldRefItmChg extends ValidatorEJB implements SoHoldRefItmChgLoca
try
{
GenericUtility genericUtility = GenericUtility.getInstance();
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
//conn = connDriver.getConnectDB("DriverITM");
//conn.setAutoCommit(false);
connDriver=null;
if(objContext != null && objContext.trim().length()>0)
{
......
......@@ -66,7 +66,7 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol
Statement st = null;
String exprNo = null;
//String confirmed = null;
String conformation = "";
String confirmation = "";
SimpleDateFormat simpleDateFrormat = null;
int upd = 0;
String procCode = "",procDateStr = "",template = "",mcCode = "",procesName = "",mcName = "",stageNo = "",procDate = "";
......@@ -156,7 +156,7 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol
String specReason = "";
String status = "";
String saleOrder = "";
String conformation = "";
String confirmation = "";
String confirmed = "";
String conf = "";
Timestamp todayDate = null;
......@@ -171,7 +171,7 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol
chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId");
loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
conn = connDriver.getConnectDB("DriverITM");
//conn.setAutoCommit(false);
conn.setAutoCommit(false);
connDriver=null;
todayDate = new java.sql.Timestamp(System.currentTimeMillis()) ;
//-------------detail 1--------------------------
......@@ -199,15 +199,15 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol
}
}
if(childNodeName.equalsIgnoreCase("conformation"))
if(childNodeName.equalsIgnoreCase("confirmation"))
{
if(childNode.getFirstChild()!=null)
{
conformation = childNode.getFirstChild().getNodeValue();
if(conformation != null && conformation.trim().length() > 0 && conformation.equalsIgnoreCase("N"))
confirmation = childNode.getFirstChild().getNodeValue();
if(confirmation != null && confirmation.trim().length() > 0 && confirmation.equalsIgnoreCase("N"))
{
errCode = "VMUNCONCOD";
errString =itmDBAccessEJB.getErrorString("conformation",errCode,chgUser);
errString =itmDBAccessEJB.getErrorString("confirmation",errCode,chgUser);
return (errString);
}
......@@ -237,16 +237,17 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol
}
}//inner for loop] lotNoFromStr
System.out.println("confirmation [" + confirmation + "]" );
if(specReason == null || specReason.trim().length() ==0 )
{
errCode = "VMRSCODNNL";
errString =itmDBAccessEJB.getErrorString("spec_reason",errCode,chgUser);
return (errString);
}
if(conformation.equalsIgnoreCase("Y") && (status.equalsIgnoreCase("P") || status.equalsIgnoreCase("H")) && (specReason != null || specReason.trim().length()!=0))
if(confirmation.equalsIgnoreCase("Y") && (status.equalsIgnoreCase("P") || status.equalsIgnoreCase("H")) && (specReason != null || specReason.trim().length()!=0))
{
sql = "update sorder set status_remarks = ? ,status = ? ,status_date = ? where sale_order = '"+saleOrder+"' and status = '"+status.trim()+"' and confirmed = '"+conformation+"' " ;
sql = "update sorder set status_remarks = ? ,status = ? ,status_date = ? where sale_order = '"+saleOrder+"' and status = '"+status.trim()+"' and confirmed = '"+confirmation+"' " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,specReason);
if(status.equalsIgnoreCase("H"))
......@@ -291,10 +292,21 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol
} // end try
catch(Exception e)
{
try{
conn.rollback();
System.out.println("Exception in SoHoldRefPrcEJB..."+e.getMessage());
e.printStackTrace();
errString = e.getMessage();
}catch(Exception ei){}
throw new ITMException(e);
}
finally
{
try{
conn.close();
conn = null;
pstmt.close();
}catch(Exception e){}
}
System.out.println("returning from SoHoldRefPrcEJB "+errString);
return (errString);
......
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