In my case, I made sure I was closing out all statements, resultsets and
connections properly. To check the connections to Informix, I run the
command onstat -u, which will send back db connection info. At the same time
I will bring up my JRun hosted web application and bring up a page that
makes a simple db query. A new connection to Informix is made. If I keep
refreshing the web page, a new and seperate connection is made each time!
Also, many of the connections never close, even if left idle over night.
Something obviously is wrong and I can't pin it down. I had posted this to
the group a while back and Scott Stirling asked me to send my
local.properties file, which I did and still have had no response. Scott,
are you out there? Please help. Here is the email I had sent:






Scott,

   I am using JRun 3.0 Service Pack 2a Version 3.02a.11614. I am using the
Informix JDBC driver Version 2.20, type 4. Here is the bottom of my
local.properties:

# list of services to start
ejb.services=ejb,jms
ranConnector=yes
java.args={default}
java.jnipath={default}
java.classpath={default}
ha4.0.rootdir=/users/HA40gui/jrun/ha4.0
ha4.0.class={webapp.service-class}
webapp.mapping./ha4.0=ha4.0
file.browsedirs=false
web-app.welcome-file-list=index.htm
jdbc.ifxConnection.display-name=Informix Connection
jdbc.ifxConnection.driver=com.informix.jdbc.IfxDriver
jdbc.ifxConnection.url=jdbc:informix-sqli://ifxHost:1492/ha_40gui:informixse
rver=ifxHostdb;user=user;password=Us3rr
jdbc.ifxConnection.description=
jdbc.ifxConnection.pooling=true
jdbc.ifxConnection.timeout=3
jdbc.ifxConnection.interval=30
jdbc.ftConnection.param.user=
jdbc.ftConnection.param.password=
jdbc.ifxConnection.param.user=
jdbc.ifxConnection.param.password=


Here is sample code:

<%@ page
import="java.io.*,java.util.*,java.sql.*,javax.sql.*,javax.naming.*;" %>


<%

        String dsName = "ifxConnection";
        Connection dbConnection = null;
        Vector employees=new Vector();
        Statement st1 = null;
        ResultSet rs1 = null;
        int rows1=0

 try {
         InitialContext ctx = new InitialContext();
        DataSource ds =(DataSource)ctx.lookup("java:comp/env/jdbc/" +
dsName);
        dbConnection = ds.getConnection();
        st1 = dbConnection.createStatement();
        rs1 = st1.executeQuery("select id from employees");

          while (rs1.next()) {
               rows1++;
               employees.addElement(rs1.getString(1));

         }
 }
 catch (SQLException ex){
       System.out.println ("\nSQLException-------------------\n");
       System.out.println ("SQLState: " + ex.getSQLState ());
       System.out.println ("Message :  " + ex.getMessage ());
 }

 finally {
    try{
          rs1.close();
          st1.close();
          dbConnection.close();
    } catch (Exception ex){}
   }
%>

 As mentioned earlier, I am the only one using this test app and yet this
still produces on average 40 or so connections that do not close. During
periods of inactivity(such as this past weekend)shouldn't these connections
close?


Thanks,
Vic



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/jrun-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to