Commit 65d59406 authored by kshinde's avatar kshinde

Update ejb file for applying lock on confirm transaction.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104240 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a18f527d
...@@ -140,9 +140,25 @@ public class WorkorderIssConf extends ActionHandlerEJB implements WorkorderIssCo ...@@ -140,9 +140,25 @@ public class WorkorderIssConf extends ActionHandlerEJB implements WorkorderIssCo
detTable ="workorder_issdet"; detTable ="workorder_issdet";
hdrTable ="workorder_iss"; hdrTable ="workorder_iss";
} }
sql = "select site_code , tran_date , dept_code , work_order, "
+" tran_type , operation , eff_date , tran_id__req " if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
+" from "+hdrTable+" where tran_id ='"+tranID+"' "; {
sql = "select site_code , tran_date , dept_code , work_order, "
+" tran_type , operation , eff_date , tran_id__req "
+" from "+hdrTable+" where tran_id ='"+tranID+"' for update ";
}
else if("mssql".equalsIgnoreCase(CommonConstants.DB_NAME))
{
sql = "select site_code , tran_date , dept_code , work_order, "
+" tran_type , operation , eff_date , tran_id__req "
+" from "+hdrTable+" (updlock) where tran_id ='"+tranID+"'";
}
else
{
sql = "select site_code , tran_date , dept_code , work_order, "
+" tran_type , operation , eff_date , tran_id__req "
+" from "+hdrTable+" where tran_id ='"+tranID+"' for update nowait ";
}
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if(rs1.next()) if(rs1.next())
...@@ -841,8 +857,21 @@ public class WorkorderIssConf extends ActionHandlerEJB implements WorkorderIssCo ...@@ -841,8 +857,21 @@ public class WorkorderIssConf extends ActionHandlerEJB implements WorkorderIssCo
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getDBDateFormat());
tranDate = java.sql.Timestamp.valueOf(sdf.format(today) + " 00:00:00.000"); tranDate = java.sql.Timestamp.valueOf(sdf.format(today) + " 00:00:00.000");
sql = "select confirmed , site_code,tran_type,tran_date,dept_code,work_order, operation, eff_date " if ("db2".equalsIgnoreCase(CommonConstants.DB_NAME ))
+ " from " + hdrTable + " where tran_id = ? "; {
sql = "select confirmed , site_code,tran_type,tran_date,dept_code,work_order, operation, eff_date "
+ " from " + hdrTable + " where tran_id = ? for update ";
}
else if("mssql".equalsIgnoreCase(CommonConstants.DB_NAME))
{
sql = "select confirmed , site_code,tran_type,tran_date,dept_code,work_order, operation, eff_date "
+ " from " + hdrTable + " (updlock) where tran_id = ? ";
}
else
{
sql = "select confirmed , site_code,tran_type,tran_date,dept_code,work_order, operation, eff_date "
+ " from " + hdrTable + " where tran_id = ? for update nowait ";
}
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranID); pstmt.setString(1,tranID);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
......
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