Commit 69c9ee57 authored by rtiwari's avatar rtiwari

add confirm method


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95675 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 469c686a
......@@ -32,11 +32,21 @@ import javax.naming.PartialResultException;
@Stateless
public class StockAllocPrc extends ActionHandlerEJB implements StockAllocPrcLocal, StockAllocPrcRemote//SessionBean {
{
// METHOD ADDED BY RITESH ON 18/07/14
public String confirm(String tranId,String xtraParams,String forcedFlag) throws RemoteException,ITMException
{
Connection conn=null;
String errString="";
errString=confirm(tranId,xtraParams,forcedFlag,conn);
System.out.println("errString----"+errString);
return errString;
public String confirm(String tranId,String xtraParams, String forcedFlag) throws RemoteException,ITMException
}
public String confirm(String tranId,String xtraParams, String forcedFlag,Connection conn) throws RemoteException,ITMException
{
Connection conn = null;
System.out.println("--confirm(String tranId,String xtraParams, String forcedFlag,Connection conn)");
//Connection conn = null;
PreparedStatement pstmt = null, pstmt1 = null ;
ResultSet rs = null, rs1 = null;
String sql = "";
......@@ -49,14 +59,24 @@ public class StockAllocPrc extends ActionHandlerEJB implements StockAllocPrcLoca
// ADDED ON 02/MAY/2014
String sqlSorditem = "";
PreparedStatement psmtSord = null;
boolean isLocal=false;
try
{
itmDBAccessEJB = new ITMDBAccessEJB();
connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
conn.setAutoCommit(false);
// ADDED BY RITESH ON 18/07/14 START
if(conn==null)
{
connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
conn.setAutoCommit(false);
isLocal=true;
}
// // METHOD ADDED BY RITESH ON 18/07/14 END
// connDriver = new ConnDriver();
// conn = connDriver.getConnectDB("DriverITM");
// connDriver = null;
// conn.setAutoCommit(false);
sql = "select confirmed,site_code from sord_alloc where tran_id = ?";
pstmt = conn.prepareStatement(sql);
......@@ -186,7 +206,12 @@ public class StockAllocPrc extends ActionHandlerEJB implements StockAllocPrcLoca
{
if(errString.indexOf("CONFSUCCES") > -1)
{
if(isLocal)
{
conn.commit();
System.out.println("Transaction commited while StockAllocPrc ==");
}
}
else
{
......@@ -215,8 +240,11 @@ public class StockAllocPrc extends ActionHandlerEJB implements StockAllocPrcLoca
rs1 = null;
}
//Changed by sumit on 21/12/12 end
conn.close();
conn = null;
if(conn!=null && isLocal)
{
conn.close();
conn = null;
}
}
catch(Exception e)
{
......
......@@ -19,4 +19,6 @@ import javax.ejb.Local; // added for ejb3
public interface StockAllocPrcLocal extends ActionHandlerLocal//,EJBObject
{
public String confirm(String tranID, String xtraParams, String forcedFlag) throws RemoteException,ITMException;
public String confirm(String tranId,String xtraParams, String forcedFlag,Connection conn) throws RemoteException,ITMException;
}
......@@ -19,4 +19,6 @@ import javax.ejb.Remote; // added for ejb3
public interface StockAllocPrcRemote extends ActionHandlerRemote//, EJBObject
{
public String confirm(String tranID, String xtraParams, String forcedFlag) throws RemoteException,ITMException;
public String confirm(String tranId,String xtraParams, String forcedFlag,Connection conn) throws RemoteException,ITMException;
}
\ No newline at end of file
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