Discussions

General J2EE: JDBC connections remains open...

  1. JDBC connections remains open... (1 messages)

    Hi,
    My project implements JDBC connection pooling using Weblogic 8.1. My application has a JSP A calling JSP B which in turn calls some reports to display back to the user. The problem is, I see open connections being shown on Weblogic even when I have closed the connection in my program. Wondering what could be the reason for this ? Any inputs would be appreciated.

    Thanks,
    -Pentium.
  2. When u have a connection pool implemented then you basically leave the container to manages the connection. The open and close you have in your code will virtually have no effects on the connection. When the pool is initialized the specific number of connection you mention in the config file is created and kept for you. So when you say you are done with a connection the connection is not destryed instead it's put back to the pool. This is to improve performance and avoid connection establishing bottle necks

    see: http://e-docs.bea.com/wls/docs81/jdbc/intro.html#1029888

    'Creating a DBMS connection is a slow operation. With connection pools, "__connections are already established__" and available to users. The alternative is for applications to make their own JDBC connections as needed. A DBMS runs faster with dedicated connections than if it has to handle incoming connection attempts at run time.'

    cheerz
    -vaheesan selvarajah.