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