[jboss-user] JDBC Connection close every 15 ...:( plz

Karthik Nanjangude karthik.nanjangude at xius-bcgi.com
Fri Jun 12 06:25:09 EDT 2009


Hi


We are facing Connection used up every 15 minutes on
We suspect the jboss server is not releasing the JDBC connection
on using the close()  method

JBOSS 4.2.1 or  4.2.3
JDK1.5.x
O/s Linux Redhat
Jdbc jar : ojdbc14.jar


Or am I missing any thing ?
Please some body help  me

The code is as shown below

//Oracle-ds.xml
<local-tx-datasource>
<jndi-name>jdbc/OrclVOISE5000</jndi-name>
<connection-url>jdbc:oracle:thin:@172.16.18.22:1521:GTS22</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>tt_VOISE50</user-name>
<password>tt_VOISE50</password>
<min-pool-size>20</min-pool-size>
<max-pool-size>80</max-pool-size>
<blocking-timeout-millis>500</blocking-timeout-millis>
<idle-timeout-minutes>1</idle-timeout-minutes>
<track-statements>false</track-statements>
<metadata>
<type-mapping>Oracle10g</type-mapping>
</metadata>
</local-tx-datasource>


// global Declared Variables
DataSource ODS = null;
WrappedConnection WCP = null;

//Singleton Pattern
public static synchronized public DBConnectionManager getInstance() throws Exception {
  if (instance == null) {
     instance = new DBConnectionManager();
  }
   return instance;
}


//Constructer
private DBConnectionManager() throws Exception {
 String DSNAME = InfinetUtility.getProperty("DSNAME").trim();
 System.out.println("DATASOURCE JNDI NAME :===>|"+DSNAME+"|<=====");
 InitialContext ic = null;
 try {
    ic = new InitialContext();
   ODS = (javax.sql.DataSource) ic.lookup(DSNAME);
 } catch (NamingException e) { e.printStackTrace();}
}


//fetch connection
public synchronized Connection getConnection(){
  Connection conn = null;
  Connection underlyingConn = null;
  OracleConnection connection= null;
  try {
    conn = ODS.getConnection();
    WCP = (WrappedConnection)conn;
    underlyingConn = WCP.getUnderlyingConnection();
    conn =  (OracleConnection)underlyingConn;
  } catch (SQLException sqlex) {
     System.out.println("<<<<<<<<<<< NO CONNECTION>>>>>>>>>>>>" + sqlex.getMessage()

   }
  return conn;
}


//Connection close
public void freeConnection(Connection con)  {
    System.out.println("RELEASING THE USED CONNECTION TO POOL");
    try {
      con.close();
    }catch (Exception e) {
        e,printStackTrace();
    }
}




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20090612/fd329f0c/attachment.html 


More information about the jboss-user mailing list