Commit 95fd6f29 authored by msharma's avatar msharma

Manoj dtd 10/09/2012 to remove connection closing issue


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91883 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 466447c5
...@@ -549,10 +549,10 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -549,10 +549,10 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
{ {
chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"); chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"); chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId");
//Commented by Manoj dtd 10/09/2012 to remove connection closing issue
ConnDriver connDriver = new ConnDriver(); /*ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;*/
parentNodeList = detailDom.getElementsByTagName("Detail2"); parentNodeList = detailDom.getElementsByTagName("Detail2");
parentNodeListLength = parentNodeList.getLength(); parentNodeListLength = parentNodeList.getLength();
System.out.println("parentNodeListLength------------------->"+parentNodeListLength); System.out.println("parentNodeListLength------------------->"+parentNodeListLength);
...@@ -602,7 +602,9 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -602,7 +602,9 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
if(allocQty > 0) if(allocQty > 0)
{ {
System.out.println("if calling........"); System.out.println("if calling........");
errString = sorderAllocate(saleOrder, lineNo, itemCode, allocQty, expLev, conn); //Commented by Manoj dtd 10/09/2012 to remove connection closing issue
//errString = sorderAllocate(saleOrder, lineNo, itemCode, allocQty, expLev,conn);
errString = sorderAllocate(saleOrder, lineNo, itemCode, allocQty, expLev);
if (errString != null && errString.trim().length() > 0) if (errString != null && errString.trim().length() > 0)
{ {
System.out.println("errString :"+errString); System.out.println("errString :"+errString);
...@@ -671,8 +673,9 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -671,8 +673,9 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
} }
} }
//Commented by Manoj dtd 10/09/2012 to remove connection closing issue
private String sorderAllocate(String saleOrder, String lineNo, String itemCode, double allocQty, String expLev, Connection conn) throws ITMException //private String sorderAllocate(String saleOrder, String lineNo, String itemCode, double allocQty, String expLev,Connection conn) throws ITMException
private String sorderAllocate(String saleOrder, String lineNo, String itemCode, double allocQty, String expLev) throws ITMException
{ {
System.out.println("updateSOrder calling .............."); System.out.println("updateSOrder calling ..............");
String getDataSql = null; String getDataSql = null;
...@@ -712,7 +715,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -712,7 +715,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
String errString = ""; String errString = "";
String error = ""; String error = "";
String errCode = ""; String errCode = "";
//Connection conn = null; Connection conn = null;
PreparedStatement pstmtStock = null; PreparedStatement pstmtStock = null;
PreparedStatement pstmtStockInsertSordAlloc = null; PreparedStatement pstmtStockInsertSordAlloc = null;
Statement st = null; Statement st = null;
...@@ -721,8 +724,8 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -721,8 +724,8 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
try try
{ {
//ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
//conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
//connDriver = null; //connDriver = null;
// 21/08/12 manoharan get the shipping site // 21/08/12 manoharan get the shipping site
getDataSql = "SELECT SITE_CODE__SHIP FROM SORDER WHERE SALE_ORDER = ? "; getDataSql = "SELECT SITE_CODE__SHIP FROM SORDER WHERE SALE_ORDER = ? ";
...@@ -860,13 +863,14 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -860,13 +863,14 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
pendingQuantity = rsSItem.getDouble(6); pendingQuantity = rsSItem.getDouble(6);
} }
rsSItem.close(); rsSItem.close();
st.close();
updateSorditem ="UPDATE SORDITEM SET QTY_ALLOC = CASE WHEN QTY_ALLOC IS NULL THEN 0 ELSE QTY_ALLOC END + " + new Double(lotQtyToBeAllocated).toString() updateSorditem ="UPDATE SORDITEM SET QTY_ALLOC = CASE WHEN QTY_ALLOC IS NULL THEN 0 ELSE QTY_ALLOC END + " + new Double(lotQtyToBeAllocated).toString()
+" WHERE SALE_ORDER = '" + saleOrder + "' " +" WHERE SALE_ORDER = '" + saleOrder + "' "
+" AND LINE_NO = '" + lineNo + "' " +" AND LINE_NO = '" + lineNo + "' "
+" AND EXP_LEV = '" + expLev + "' "; +" AND EXP_LEV = '" + expLev + "' ";
System.out.println("updateSql------->"+updateSorditem); System.out.println("updateSql------->"+updateSorditem);
st = conn.createStatement();
st.executeUpdate(updateSorditem); st.executeUpdate(updateSorditem);
System.out.println("UPDATE SUCCESS FOR SORDITEM....>>>>>>>>"); System.out.println("UPDATE SUCCESS FOR SORDITEM....>>>>>>>>");
...@@ -885,6 +889,11 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -885,6 +889,11 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
{ {
count = rsSItem.getInt(1); count = rsSItem.getInt(1);
} }
rsSItem.close();
rsSItem=null;
st.close();
st=null;
if (count > 0 ) if (count > 0 )
{ {
updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC + " + new Double(lotQtyToBeAllocated).toString() updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC + " + new Double(lotQtyToBeAllocated).toString()
...@@ -897,7 +906,10 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -897,7 +906,10 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
+ " AND LOT_SL = '" + lotSl + "' " + " AND LOT_SL = '" + lotSl + "' "
+ " AND LOC_CODE = '" + locCode + "' " ; + " AND LOC_CODE = '" + locCode + "' " ;
System.out.println("updateSql:::>>>>"+ updateSql); System.out.println("updateSql:::>>>>"+ updateSql);
st = conn.createStatement();
st.executeUpdate(updateSql); st.executeUpdate(updateSql);
st.close();
st=null;
System.out.println("UPDATE SUCCESS FOR SORDALLOC...."); System.out.println("UPDATE SUCCESS FOR SORDALLOC....");
} }
else else
...@@ -989,7 +1001,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -989,7 +1001,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
System.out.println("insertion success ...............>>>>>>>>"); System.out.println("insertion success ...............>>>>>>>>");
pstmtStockInsertSordAlloc.close(); pstmtStockInsertSordAlloc.close();
}//end else }//end else
st.close(); //st.close();
}//end of if(lotQtyToBeAllocated > 0) }//end of if(lotQtyToBeAllocated > 0)
}//end of while }//end of while
......
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