Commit 7470fae6 authored by akhokar's avatar akhokar

Changes done for connection is not getting closed

RecoPattItmChg.java
RecoveryPattern.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@200737 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4cd19aed
package ibase.webitm.ejb.adm;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
import javax.ejb.CreateException;
import java.sql.SQLException;
import javax.ejb.Stateless; // added for ejb3
//import javax.ejb.SessionBean;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.ejb.Stateless; // added for ejb3
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
@Stateless // added for ejb3
public class RecoPattItmChg extends ValidatorEJB implements RecoPattItmChgLocal,RecoPattItmChgRemote //SessionBean
......@@ -84,13 +81,18 @@ public class RecoPattItmChg extends ValidatorEJB implements RecoPattItmChgLocal,
int currentFormNo = 0 ,cnt = 0;
String tranId="",deptCode = "", roleCodePrfmer = "", siteCode = "", empCode = "";
String sql = "",descr = "",empFName = "", empMName = "", empLName = "",roleCodeAprv="";
ConnDriver connDriver = new ConnDriver();
//Modified by Azhar on [13-05-2019][To do changes for connection not getting closed][Start]
//ConnDriver connDriver = new ConnDriver();
//Modified by Azhar on [13-05-2019][To do changes for connection not getting closed][End]
try
{
GenericUtility genericUtility = GenericUtility.getInstance();
conn = connDriver.getConnectDB("DriverITM");
//Modified by Azhar on [13-05-2019][To do changes for connection not getting closed][Start]
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
conn.setAutoCommit(false);
connDriver=null;
//connDriver=null;
//Modified by Azhar on [13-05-2019][To do changes for connection not getting closed][End]
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
......@@ -143,6 +145,21 @@ public class RecoPattItmChg extends ValidatorEJB implements RecoPattItmChgLocal,
}
finally
{
//Modified by Azhar on [13-05-2019][To do changes for connection not getting closed][Start]
try
{
if(conn != null)
{
conn.close();
conn = null;
}
}
catch (SQLException e)
{
e.printStackTrace();
throw new ITMException(e);
}
//Modified by Azhar on [13-05-2019][To do changes for connection not getting closed][End]
}
return valueXmlString.toString();
}//END OF ITEMCHANGE
......
......@@ -7,27 +7,27 @@
********************************************************/
package ibase.webitm.ejb.adm;
import ibase.webitm.utility.*;
import ibase.utility.CommonConstants;
import ibase.webitm.ejb.*;
import ibase.system.config.*;
import java.rmi.RemoteException;
import java.text.*;
import java.util.*;
import java.sql.*;
import org.w3c.dom.*;
import javax.xml.parsers.*;
import javax.ejb.*;
import javax.naming.InitialContext;
import java.io.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import javax.ejb.Stateless; // added for ejb3
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ProcessEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
@Stateless // added for ejb3
public class RecoveryPattern extends ProcessEJB implements RecoveryPatternLocal,RecoveryPatternRemote //SessionBean
{
......@@ -246,15 +246,19 @@ public class RecoveryPattern extends ProcessEJB implements RecoveryPatternLocal,
String loginSiteCode = "";
String loginCode = "";
DecimalFormat df = new DecimalFormat("0.00");
ConnDriver connDriver = new ConnDriver();
//Modified by Azhar on [13-05-2019][To do changes for connection not getting closed][Start]
//ConnDriver connDriver = new ConnDriver();
//Modified by Azhar on [13-05-2019][To do changes for connection not getting closed][End]
try
{
ConnDriver conndriver = new ConnDriver();
System.out.println("oracle driver found:-" + conndriver);
conn = conndriver.getConnectDB("DriverITM");
{ //Modified by Azhar on [13-05-2019][To do changes for connection not getting closed][Start]
//ConnDriver conndriver = new ConnDriver();
//System.out.println("oracle driver found:-" + conndriver);
//conn = conndriver.getConnectDB("DriverITM");
conn = getConnection();
System.out.println("U r connected to oracle :-" + conn );
conn.setAutoCommit(false);
connDriver = null;
//connDriver = null;
//Modified by Azhar on [13-05-2019][To do changes for connection not getting closed][End]
System.out.println("xtraParams :::::::::::::::::::::::::::::::::: "+xtraParams);
loginSiteCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginSiteCode");
empCodeStr = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginEmpCode");
......@@ -585,15 +589,18 @@ public class RecoveryPattern extends ProcessEJB implements RecoveryPatternLocal,
{
retTabSepStrBuff = null;
conn.rollback();
//Modified by Azhar on [13-05-2019][To do changes for connection not getting closed][Start]
if(conn != null)
{
conn.close();
conn = null;
}
//Modified by Azhar on [13-05-2019][To do changes for connection not getting closed][End]
if(pstmt != null)
{
pstmt.close();
pstmt=null;
}
conn.close();
}
}
catch(Exception e)
{
......
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