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 ...@@ -98,8 +98,8 @@ public class SoHoldRefItmChg extends ValidatorEJB implements SoHoldRefItmChgLoca
try try
{ {
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
conn = connDriver.getConnectDB("DriverITM"); //conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false); //conn.setAutoCommit(false);
connDriver=null; connDriver=null;
if(objContext != null && objContext.trim().length()>0) if(objContext != null && objContext.trim().length()>0)
{ {
......
...@@ -66,7 +66,7 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol ...@@ -66,7 +66,7 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol
Statement st = null; Statement st = null;
String exprNo = null; String exprNo = null;
//String confirmed = null; //String confirmed = null;
String conformation = ""; String confirmation = "";
SimpleDateFormat simpleDateFrormat = null; SimpleDateFormat simpleDateFrormat = null;
int upd = 0; int upd = 0;
String procCode = "",procDateStr = "",template = "",mcCode = "",procesName = "",mcName = "",stageNo = "",procDate = ""; String procCode = "",procDateStr = "",template = "",mcCode = "",procesName = "",mcName = "",stageNo = "",procDate = "";
...@@ -156,7 +156,7 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol ...@@ -156,7 +156,7 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol
String specReason = ""; String specReason = "";
String status = ""; String status = "";
String saleOrder = ""; String saleOrder = "";
String conformation = ""; String confirmation = "";
String confirmed = ""; String confirmed = "";
String conf = ""; String conf = "";
Timestamp todayDate = null; Timestamp todayDate = null;
...@@ -171,7 +171,7 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol ...@@ -171,7 +171,7 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol
chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId"); chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId");
loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode"); loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
//conn.setAutoCommit(false); conn.setAutoCommit(false);
connDriver=null; connDriver=null;
todayDate = new java.sql.Timestamp(System.currentTimeMillis()) ; todayDate = new java.sql.Timestamp(System.currentTimeMillis()) ;
//-------------detail 1-------------------------- //-------------detail 1--------------------------
...@@ -199,15 +199,15 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol ...@@ -199,15 +199,15 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol
} }
} }
if(childNodeName.equalsIgnoreCase("conformation")) if(childNodeName.equalsIgnoreCase("confirmation"))
{ {
if(childNode.getFirstChild()!=null) if(childNode.getFirstChild()!=null)
{ {
conformation = childNode.getFirstChild().getNodeValue(); confirmation = childNode.getFirstChild().getNodeValue();
if(conformation != null && conformation.trim().length() > 0 && conformation.equalsIgnoreCase("N")) if(confirmation != null && confirmation.trim().length() > 0 && confirmation.equalsIgnoreCase("N"))
{ {
errCode = "VMUNCONCOD"; errCode = "VMUNCONCOD";
errString =itmDBAccessEJB.getErrorString("conformation",errCode,chgUser); errString =itmDBAccessEJB.getErrorString("confirmation",errCode,chgUser);
return (errString); return (errString);
} }
...@@ -237,16 +237,17 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol ...@@ -237,16 +237,17 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol
} }
}//inner for loop] lotNoFromStr }//inner for loop] lotNoFromStr
System.out.println("confirmation [" + confirmation + "]" );
if(specReason == null || specReason.trim().length() ==0 ) if(specReason == null || specReason.trim().length() ==0 )
{ {
errCode = "VMRSCODNNL"; errCode = "VMRSCODNNL";
errString =itmDBAccessEJB.getErrorString("spec_reason",errCode,chgUser); errString =itmDBAccessEJB.getErrorString("spec_reason",errCode,chgUser);
return (errString); 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 = conn.prepareStatement(sql);
pstmt.setString(1,specReason); pstmt.setString(1,specReason);
if(status.equalsIgnoreCase("H")) if(status.equalsIgnoreCase("H"))
...@@ -291,10 +292,21 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol ...@@ -291,10 +292,21 @@ public class SoHoldRefPrc extends ProcessEJB implements SoHoldRefPrcLocal, SoHol
} // end try } // end try
catch(Exception e) catch(Exception e)
{ {
try{
conn.rollback();
System.out.println("Exception in SoHoldRefPrcEJB..."+e.getMessage()); System.out.println("Exception in SoHoldRefPrcEJB..."+e.getMessage());
e.printStackTrace(); e.printStackTrace();
errString = e.getMessage(); 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); System.out.println("returning from SoHoldRefPrcEJB "+errString);
return (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