Connections does not returned to pool.I am using DB2 9.1 and Tomcat 7.0.47

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dhritideveloper
    New Member
    • Mar 2014
    • 1

    Connections does not returned to pool.I am using DB2 9.1 and Tomcat 7.0.47

    Connections does not returned to the pool, the size of the connection pool increases more than the maxSize. I am using the `DB2 9.1`and `Tomcat 7.0.47`.
    To connect to database I have to use db2jcc.jar & db2jcc_license_ cu.jar of DB2 9.5 as jars of 9.1 does not work properly.
    I am setting `maxSize = "30"` but when I see the database connection log it shows connection more than `30` and it increases to `100` and after that database gets locked. I am using Applet, Servlet & Javabeans (for business logic).I also close all my connections,sta tements in my applications.

    I have configure the Tomcat by changing the `web.xml`, `context.xml` and `server.xml` (which are at the conf directry of the server). The configurations are as follows
    **web.xml**
    Code:
    <web-app> <resource-ref> <description>DB2 Datasource example</description> <res-ref-name>jdbc/datasourcename</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </web-app>
    **context.xml**
    Code:
    <Context> <ResourceLink name="jdbc/datasourcename" global="jdbc/datasourcename" type="javax.sql.DataSource" /> </Context>
    SERVER.XML

    Code:
    <GlobalNamingResources> <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved"
    factory="org.apache.catalina.users.MemoryUserDatab aseFactory"
    pathname="conf/tomcat-users.xml" /> <Resource name="jdbc/datasourcename" auth="Container" 
    type="javax.sql.DataSource"
    factory="org.apache.tomcat.jdbc.pool.DataSourceFac tory"
    testWhileIdle="true"
    testOnBorrow="true"
    testOnReturn="false"
    validationQuery="SELECT 1"
    validationInterval="30000"
    timeBetweenEvictionRunsMillis="30000"
    maxActive="30"
    minIdle="1"
    maxWait="10000"
    initialSize="1"
    removeAbandonedTimeout="60"
    logAbandoned="true"
    removeAbandoned="true"
    closeMethod="close" 
    abandonWhenPercentageFull="60"
    minEvictableIdleTimeMillis="3000"
    jmxEnabled="true" jdbcInterceptors="org.apache.tomcat.jdbc.pool.inte rceptor.ConnectionState;org.apache.tomcat.jdbc.poo l.interceptor.StatementFinalizer"
    alternateUsernameAllowed="true"
    username="user"
    password="pass"	
    driverClassName="com.ibm.db2.jcc.DB2Driver"	
    url="jdbc:db2:://127.0.0.1:50000/DBname" /> </GlobalNamingResources>
Working...