Try removing the maxIdle and maxActive parameters so that defaults are used - these 
are much lower than the 30 and 100 in your configuration.

I had the same problem with Oracle.

HTH

Eric

-----Original Message-----
From: Gerlinde Fischer [mailto:[EMAIL PROTECTED]
Sent: 06 March 2003 12:06
To: [EMAIL PROTECTED]
Subject: DBCP problems connection does not return


Hi,

I have the following problem:
The connection seems to be connected, but it does not return.
I want to use the naming datasource from tomcat.

Configuration: tomcat 4.1.18 standalone, database sapdb (I although tried
mysql, the same behaviour)
linux 8.0
commons-dbcp.jar, commons-pool.jar and sapdbc.jar in the common/lib
directory.

configuration in the server.xml file.

in my context whb I have made the following configuration:
------
          <Resource auth="Container" description="DB Connection"
name="jdbc/SapdbDS" scope="Shareable" type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/SapdbDS">
            <parameter>
              <name>url</name>
              <value>jdbc:sapdb://127.0.0.1/WHB?autocommit=off</value>
            </parameter>
            <parameter>
              <name>validationQuery</name>
              <value>select count(*) from katver</value>
            </parameter>
            <parameter>
              <name>maxIdle</name>
              <value>30</value>
            </parameter>
            <parameter>
              <name>maxActive</name>
              <value>100</value>
            </parameter>
            <parameter>
              <name>driverClassName</name>
              <value>com.sap.dbtech.jdbc.DriverSapDB</value>
            </parameter>
            <parameter>
              <name>maxWait</name>
              <value>5</value>
            </parameter>
            <parameter>
              <name>removeAbandoned</name>
              <value>true</value>
            </parameter>
            <parameter>
              <name>username</name>
              <value>user</value>
            </parameter>
            <parameter>
              <name>factory</name>
              <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
            </parameter>
             <parameter>
              <name>logAbandoned</name>
              <value>true</value>
            </parameter>
            <parameter>
              <name>removeAbandonedTimeout</name>
              <value>300</value>
            </parameter>
            <parameter>
              <name>password</name>
              <value>pw</value>
            </parameter>
          </ResourceParams>

----

It seems that I can connect to the database,
but the connection does not return.

Here the code with which I want to connect.
--------
  public Connection getConnection() throws SQLException {
  Connection con1=null;
    try
    {
    InitialContext initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    DataSource ds = (DataSource) envCtx.lookup("jdbc/SapdbDS");
    System.out.println("imTry  getconnecion nach datasource: ");
    con1 = ds.getConnection();
    System.out.println("imTry  nach getConntection: ");

    }
    catch (Exception e)
    {
      System.out.println("Fehler: getconnection " + e.getMessage());
      System.exit(1);
    }
  return con1;
  }
------

In the log-file catalina.out I found the following:
---

imTry  getconnecion nach datasource:
---

The output:  imTry  nach getConntection: does not appear.
After 2 hours on the web page I got. "page could not displaced".

Regrads Gerlinde


Universität Bamberg
Lehrstuhl für Wirtschaftsinformatik
Prof. Dr. Elmar J. Sinz
Projekt FlexNow!
Tel: ++49 951 863 2775
Fax: ++49 951 863 1195


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to