[jboss-user] [JCA/JBoss] - Re: Connection in Use Keeps going Up Jboss 4.0.4.GA Jboss 4.

kazam do-not-reply at jboss.com
Tue Oct 17 15:39:42 EDT 2006


More Information
------------------------

Looking at the forum, I think I am missing this piece of information.

This is how I am retrieving my connections

  | protected Connection retrieveConnection() 
  |   {
  |     DataSource oradbConnection;
  |     
  |     try
  |     {
  |       //Get DataSource from JNDI repository in JBoss 4.0.2
  |       Context jndiContext= new InitialContext();
  |       oradbConnection=(DataSource)jndiContext.lookup("java:jdbc/oracle");
  |       return oradbConnection.getConnection();
  |     
  |     }
  |    catch(NamingException e)
  |     {
  |       throw new RuntimeException("NamingException: Failed to retrieve initial naming Context through JNDI : "+ e.getMessage(),e);
  |     }
  |     catch(SQLException e)
  |     {
  |       throw new RuntimeException("SQLException: Failed to retrieve DB connection from JNDI connection pool : "+e.getMessage(),e);
  |     }
  |   } 
  | 

All connections are being closed in finally block. 

Please look at the previous 2 posts for problem description and information.
Thanks, kazam.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978869#3978869

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978869



More information about the jboss-user mailing list