Commit 8ea1c349 authored by manohar's avatar manohar

bug fixing for connection close


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91871 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 20d13d54
......@@ -826,7 +826,8 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
if (errString != null && errString.trim().length() > 0)
{
System.out.println("errString :::"+ errString );
System.out.println("manohar connection rolledback errString :::"+ errString );
conn.rollback()
return errString;
}
......@@ -995,6 +996,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
rs.close();
pstmtStock.clearParameters();
pstmtStock.close();
System.out.println("manohar connection commited errString :::"+ errString );
conn.commit();
}
catch(SQLException se)
......@@ -1002,6 +1004,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
System.out.println("SQLException :" + se);
se.printStackTrace();
errString = se.getMessage();
System.out.println("manohar connection rolledback errString 3 :::"+ errString );
conn.rollback();
return errString;
}
......@@ -1013,6 +1016,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
e.printStackTrace();
try
{
System.out.println("manohar connection rolledback errString 2 :::"+ errString );
conn.rollback();
}
catch(Exception e1)
......@@ -1026,13 +1030,14 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
finally
{
try
{
if(conn != null)
{
if (errString == null || errString.trim().length() == 0)
{
System.out.println("manohar connection commited errString :::"+ errString );
conn.commit();
}
if(conn != null)
{
if(pstmtStock != null)
{
pstmtStock.close();
......@@ -1167,6 +1172,8 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
System.out.println("insertion of sql inside updateInvallocTrace success on date "+ chgDate);
System.out.println("Stock Updated...............................");
if(allocQty >= 0)
{
sqlUpdate = "UPDATE STOCK SET ALLOC_QTY =(CASE WHEN ALLOC_QTY IS NULL THEN 0 ELSE ALLOC_QTY END) + ? "
+"WHERE ITEM_CODE = ? AND SITE_CODE = ? AND LOC_CODE = ? AND LOT_NO = ? AND LOT_SL = ?";
......@@ -1177,8 +1184,6 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
pstmt.setString(4,locCode);
pstmt.setString(5,lotNo);
pstmt.setString(6,lotSl);
if(allocQty >= 0)
{
pstmt.executeUpdate();
}
System.out.println("Updated End.");
......@@ -1217,8 +1222,8 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
{
try
{
if(conn != null)
{
//if(conn != null)
//{
if(pstmt != null)
{
pstmt.close();
......@@ -1229,9 +1234,9 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
stmt.close();
stmt = null;
}
conn.close();
conn = null;
}
//conn.close();
//conn = null;
//}
}
catch(Exception e)
{
......
......@@ -1673,7 +1673,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
}
// 05/05/01 manoharan if all the PO Details are closed
// then close the PO Header also
if(errString != null && errString.indexOf("Error") != -1 && purcOrder != null )
if(errString != null && errString.indexOf("Error") == -1 && purcOrder != null )
{
sql = "select count(1) from porddet where purc_order = ? And (case when status is null then ' ' else status end) <> 'C' " ;
pstmt1 = conn.prepareStatement(sql);
......
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