Commit f75fd0de authored by smestry's avatar smestry

close the resultset and prepared statment.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101896 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4562c7f2
......@@ -2349,8 +2349,21 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
}
}
System.out.println(" inv_stat ["+invStat+"]");
rs.close(); rs = null;
pstmt.close(); pstmt = null;
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [Start]
//rs.close(); rs = null;
//pstmt.close(); pstmt = null;
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [End]
////////////////////// replenishment deallocating
if( currentReplOrder.trim().length() > 0 && "PSO".equalsIgnoreCase(invStat) && parentReplOrder.trim().length() == 0)
......@@ -2660,9 +2673,17 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
{
try
{
// Changed by Sneha on 10-05-2016, closing the resultset [Start]
if( rs != null)
{
rs.close();
rs = null;
}
// Changed by Sneha on 10-05-2016, closing the resultset [End]
if( pstmt != null)
{
pstmt.close(); pstmt = null;
pstmt.close();
pstmt = null;
}
}
catch(Exception ex)
......
......@@ -159,6 +159,11 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
//Changed By Pragyan 17-APR-14 To get Hold Qty from the stock
double holdQuantity =0.0;
// Changed by Sneha on 09-06-2016, to avoid record locking [Start]
ArrayList<HashMap<String,Object>> pickOrderDetList = new ArrayList<HashMap<String,Object>>();
String pickOrderUpdate = "";
// Changed by Sneha on 09-06-2016, to avoid record locking [End]
try
{
if ( conn == null )
......@@ -352,6 +357,7 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
// a separate probably in stockupdate so that we can call the same from various places
//
//
// Changed by Manish on 05/11/15 for DDWMS merging [start]
projectName = distCommon.getDisparams("999999","PROJECT",conn);
......@@ -367,7 +373,16 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
}
}
lineNo = rs.getInt( "LINE_NO" );
// Changed by Sneha on 09-06-2016, to avoid record locking [Start]
HashMap<String,Object> pickOrderDetHm = new HashMap<String,Object>();
pickOrderDetHm.put("PICK_ORDER", replOrder);
pickOrderDetHm.put("LINE_NO__ORD", lineNoOrd);
pickOrderDetHm.put("LINE_NO", lineNo);
pickOrderDetList.add(pickOrderDetHm);
// Changed by Sneha on 09-06-2016, to avoid record locking [End]
pstmtStock.setString(1,itemCode);
pstmtStock.setString(2,siteCode);
pstmtStock.setString(3,locCode);
......@@ -967,7 +982,9 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
updCnt = pstmtUpd.executeUpdate();
// end 16/10/11 manoharan update sordalloc
*/ //Changed on 07/12/12 By Pragyan To check the sordalloc allocated quantity > quantity then insert new record deducte quantity from old location.end
String updatePickOrdSql = "UPDATE PICK_ORD_DET SET STATUS = ? "
// Commented by Sneha on 09-06-2016, to avoid record locking [Start]
/*String updatePickOrdSql = "UPDATE PICK_ORD_DET SET STATUS = ? "
+ " WHERE PICK_ORDER = ? AND LINE_NO = ? ";
pstmtUpdPickOrdDet = conn.prepareStatement(updatePickOrdSql);
......@@ -1017,8 +1034,10 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
{
pstmtUpdPickOrdDet.close();
pstmtUpdPickOrdDet=null;
}
}*/
//End Changed by Dhanraj.23-Aug-14 Close pstm and rs stmt For Maxinum cursor open.
// Commented by Sneha on 09-06-2016, to avoid record locking [End]
}
//Start Changed by Dhanraj.23-Aug-14 add first check rs and pstm null or not then close.
/*rs.close();
......@@ -1053,15 +1072,69 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
pstmtUpdPickOrdDet = null;
}
//Changed by Rohan on 21-06-13 for closing prepared statement.end
if (retString != null && retString.trim().length() > 0 )
{
isError = true;
return retString;
}
// Changed by Sneha on 09-06-2016, to avoid record locking [Start]
HashMap<String, Object> pickOrderDet = new HashMap<String, Object>();
Iterator<HashMap<String, Object>> iterator = pickOrderDetList.iterator();
while (iterator.hasNext())
{
System.out.println("Inside pickOrderDetList iterator ======= ");
pickOrderDet = (HashMap<String, Object>) iterator.next();
pickOrderUpdate = (String) pickOrderDet.get("PICK_ORDER");
lineNoOrd = (Integer) (pickOrderDet.get("LINE_NO__ORD"));
lineNo = (Integer) (pickOrderDet.get("LINE_NO"));
/*
System.out.println("pickOrderUpdate ======= " + pickOrderUpdate);
System.out.println("lineNoOrd ======= " + lineNoOrd);
System.out.println("lineNo ======= " + lineNo);*/
String updatePickOrdSql = "UPDATE PICK_ORD_DET SET STATUS = ? WHERE PICK_ORDER = ? AND LINE_NO = ? ";
pstmtUpdPickOrdDet = conn.prepareStatement(updatePickOrdSql);
pstmtUpdPickOrdDet.setString(1, "C");
pstmtUpdPickOrdDet.setString(2, pickOrderUpdate);
pstmtUpdPickOrdDet.setInt(3, lineNoOrd);
updCntPickOrdDet = pstmtUpdPickOrdDet.executeUpdate();
if(pstmtUpdPickOrdDet != null)
{
pstmtUpdPickOrdDet.close();
pstmtUpdPickOrdDet=null;
}
updatePickOrdSql = "UPDATE PICK_ISS_DET SET LOC_CODE = ? WHERE TRAN_ID = ? AND LINE_NO = ? ";
pstmtUpdPickOrdDet = conn.prepareStatement(updatePickOrdSql);
if(("A".equalsIgnoreCase(pickType)) || ("M".equalsIgnoreCase(pickType)))
{
pstmtUpdPickOrdDet.setString(1, stagingLoc);
}
else
{
pstmtUpdPickOrdDet.setString(1, locCodeTo);
}
pstmtUpdPickOrdDet.setString(2, tranId);
pstmtUpdPickOrdDet.setInt(3, lineNo);
updCntPickOrdDet = pstmtUpdPickOrdDet.executeUpdate();
if(updCntPickOrdDet > 0)
{
isUpdatehdr = updatePickOrderHeader(pickOrderUpdate,conn);
}
if(pstmtUpdPickOrdDet != null)
{
pstmtUpdPickOrdDet.close();
pstmtUpdPickOrdDet=null;
}
}
// Changed by Sneha on 09-06-2016, to avoid record locking [End]
updateSql = "UPDATE PICK_ISS_HDR SET CONFIRMED = 'Y', CONF_DATE = ?, EMP_CODE__APRV = ?"
+ " WHERE TRAN_ID = ? ";
pstmt = conn.prepareStatement(updateSql);
......
......@@ -457,10 +457,23 @@ public class PoRcpArtIC extends ValidatorEJB implements PoRcpArtICRemote, PoRcpA
errFields.add( childNodeName.toLowerCase() );
}
rsLocCode.close();
rsLocCode= null;
pstmtLocCode.close();
pstmtLocCode = null;
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [Start]
//rsLocCode.close();
//rsLocCode= null;
//pstmtLocCode.close();
//pstmtLocCode = null;
if (rsLocCode != null)
{
rsLocCode.close();
rsLocCode = null;
}
if (pstmtLocCode != null)
{
pstmtLocCode.close();
pstmtLocCode = null;
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [End]
}
}
......@@ -1482,6 +1495,19 @@ public class PoRcpArtIC extends ValidatorEJB implements PoRcpArtICRemote, PoRcpA
{
try
{
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [Start]
if (rsLocCode != null)
{
rsLocCode.close();
rsLocCode = null;
}
if (pstmtLocCode != null)
{
pstmtLocCode.close();
pstmtLocCode = null;
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [End]
if (rs != null)
{
rs.close();
......
......@@ -356,10 +356,23 @@ public class PoRcpIC extends ValidatorEJB implements PoRcpICRemote, PoRcpICLocal
errFields.add( childNodeName.toLowerCase() );
}
//Changes by Dadaso pawar on 19/FEB/15 [End]
rsLocCode.close();
rsLocCode= null;
pstmtLocCode.close();
pstmtLocCode = null;
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [Start]
//rsLocCode.close();
//rsLocCode= null;
//pstmtLocCode.close();
//pstmtLocCode = null;
if (rsLocCode != null)
{
rsLocCode.close();
rsLocCode = null;
}
if (pstmtLocCode != null)
{
pstmtLocCode.close();
pstmtLocCode = null;
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [End]
}
}
......@@ -1634,6 +1647,20 @@ public class PoRcpIC extends ValidatorEJB implements PoRcpICRemote, PoRcpICLocal
{
try
{
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [Start]
if (rsLocCode != null)
{
rsLocCode.close();
rsLocCode = null;
}
if (pstmtLocCode != null)
{
pstmtLocCode.close();
pstmtLocCode = null;
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [End]
if (rs != null)
{
rs.close();
......
......@@ -499,10 +499,23 @@ public class PoRcpRmPmIC extends ValidatorEJB implements PoRcpRmPmICRemote, PoRc
}
}
//Changes by Dadaso pawar on 19/FEB/15 [End]
rsLocCode.close();
rsLocCode= null;
pstmtLocCode.close();
pstmtLocCode = null;
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [Start]
//rsLocCode.close();
//rsLocCode= null;
//pstmtLocCode.close();
//pstmtLocCode = null;
if (rsLocCode != null)
{
rsLocCode.close();
rsLocCode = null;
}
if (pstmtLocCode != null)
{
pstmtLocCode.close();
pstmtLocCode = null;
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [End]
}
}
......@@ -2235,6 +2248,19 @@ public class PoRcpRmPmIC extends ValidatorEJB implements PoRcpRmPmICRemote, PoRc
{
try
{
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [Start]
if (rsLocCode != null)
{
rsLocCode.close();
rsLocCode = null;
}
if (pstmtLocCode != null)
{
pstmtLocCode.close();
pstmtLocCode = null;
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [End]
if (rs != null)
{
rs.close();
......
......@@ -676,6 +676,19 @@ public class StockTransferIC extends ValidatorEJB implements StockTransferICRemo
invStatLoc = checkNull(rs.getString("INV_STAT"));
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [Start]
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [End]
for(int i =0; i < locList.length ; i++)
{
......@@ -1611,6 +1624,18 @@ public class StockTransferIC extends ValidatorEJB implements StockTransferICRemo
invStat = checkNull(rs.getString("INV_STAT"));
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [Start]
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [End]
NoslInvstat = distCommon.getDisparams("999999","INV_NO_SL",conn);
if( invStat.trim().equalsIgnoreCase(NoslInvstat) )
......@@ -1735,6 +1760,19 @@ public class StockTransferIC extends ValidatorEJB implements StockTransferICRemo
invStat = checkNull(rs.getString("INV_STAT"));
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [Start]
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [End]
NoslInvstat = distCommon.getDisparams("999999","INV_NO_SL",conn);
if( invStat.trim().equalsIgnoreCase(NoslInvstat) )
......
......@@ -1257,6 +1257,20 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
rs.close();
rs = null;
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [Start]
if(rsInv != null)
{
rsInv.close();
rsInv = null;
}
if(pstmtInv != null)
{
pstmtInv.close();
pstmtInv = null;
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [End]
if(pstmtUpd != null)
{
pstmtUpd.close();
......@@ -1267,11 +1281,13 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
pstmtSord.close();
pstmtSord = null;
}
if( conn != null && ! conn.isClosed() && connStatus)
// Changed by Sneha on 10-05-2016, closing the connection [End]
/*if( conn != null && ! conn.isClosed() && connStatus)
{
conn.close();
conn = null;
}
}*/
// Changed by Sneha on 10-05-2016, closing the connection [End]
if(pstmtWave != null)
{
pstmtWave.close();
......@@ -1282,6 +1298,13 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
rsWave.close();
rsWave = null;
}
// Changed by Sneha on 10-05-2016, closing the connection [End]
if( conn != null && ! conn.isClosed() && connStatus)
{
conn.close();
conn = null;
}
// Changed by Sneha on 10-05-2016, closing the connection [End]
}
catch(Exception e)
{
......
......@@ -331,6 +331,18 @@ etc
//Changed by sumit on 13/05/13 add cust code delivery
custCodeDlv = rs.getString("CUST_CODE__DLV").trim();
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [Start]
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [End]
if(dateFrom != null)
{
......@@ -842,6 +854,19 @@ etc
{
try
{
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [Start]
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [End]
if(conn != null)
{
conn.close();
......
......@@ -22277,7 +22277,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
return pin;
}
//Changed by Rohan on 06-02-13 for not considering sSQL in case of checkForReplenishment
private String checkForReplenishment(String itemCode,String siteCode,String lotNo,String lotSl,String locCode,Double quantity,int flag,Connection conn) throws ITMException
private String checkForReplenishment(String itemCode,String siteCode,String lotNo,String lotSl,String locCode,Double quantity,int flag,Connection conn) throws ITMException, SQLException
{
String returnString="Y";
ArrayList tempItemInfoList =new ArrayList();
......@@ -22508,7 +22508,21 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
e.printStackTrace();
throw new ITMException(e);
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [Start]
finally
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
// Changed by Sneha on 10-05-2016, closing the resultset & preparedstatment [End]
return returnString;
}
......
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