473,385 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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,statements 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**
Expand|Select|Wrap|Line Numbers
  1. <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>
  2.  
**context.xml**
Expand|Select|Wrap|Line Numbers
  1.  
  2. <Context> <ResourceLink name="jdbc/datasourcename" global="jdbc/datasourcename" type="javax.sql.DataSource" /> </Context>
  3.  
SERVER.XML

Expand|Select|Wrap|Line Numbers
  1. <GlobalNamingResources> <Resource name="UserDatabase" auth="Container"
  2. type="org.apache.catalina.UserDatabase"
  3. description="User database that can be updated and saved"
  4. factory="org.apache.catalina.users.MemoryUserDatab aseFactory"
  5. pathname="conf/tomcat-users.xml" /> <Resource name="jdbc/datasourcename" auth="Container" 
  6. type="javax.sql.DataSource"
  7. factory="org.apache.tomcat.jdbc.pool.DataSourceFac tory"
  8. testWhileIdle="true"
  9. testOnBorrow="true"
  10. testOnReturn="false"
  11. validationQuery="SELECT 1"
  12. validationInterval="30000"
  13. timeBetweenEvictionRunsMillis="30000"
  14. maxActive="30"
  15. minIdle="1"
  16. maxWait="10000"
  17. initialSize="1"
  18. removeAbandonedTimeout="60"
  19. logAbandoned="true"
  20. removeAbandoned="true"
  21. closeMethod="close" 
  22. abandonWhenPercentageFull="60"
  23. minEvictableIdleTimeMillis="3000"
  24. jmxEnabled="true" jdbcInterceptors="org.apache.tomcat.jdbc.pool.inte rceptor.ConnectionState;org.apache.tomcat.jdbc.poo l.interceptor.StatementFinalizer"
  25. alternateUsernameAllowed="true"
  26. username="user"
  27. password="pass"    
  28. driverClassName="com.ibm.db2.jcc.DB2Driver"    
  29. url="jdbc:db2:://127.0.0.1:50000/DBname" /> </GlobalNamingResources>
  30.  
Mar 27 '14 #1
0 1678

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Miles Davenport | last post by:
I have the following code (please see base of email) which displays text from a properties file ok. I have changed the properties file so the contents are different, but cannot get the new...
1
by: kommaraju | last post by:
iam a starter to db2 & jdbc.i have a servlet program which connects to ibm db2 using jdbc.when i run this using apache tomcat 4.1.34 , it is showing a error message of HTTP STATUS 500 my jdbc...
5
by: singhkeshav | last post by:
Hello everyone...I am a beginner at programming database systems and i recently created one for my company using Visual Basic 6.0 and Microsoft Access 2003. I am facing some difficulty with the...
2
by: MicroMinds | last post by:
Hi, I have installed jdk 6 and tomcat 4.1.29 in my local machine. Just want to run some sample web application. When tried to check if tomcat works fine using http://localhost:8080, I'm getting...
0
by: samy2005 | last post by:
Initialising Coyote HTTP/1.1 on port 8000 SEVERE: Parse Fatal error at line 1 col1 : content is not allowed in prolog while using catalina run
4
by: shivapadma | last post by:
1.I installed apache tomcat. 2.I have the following java servlet import java.io.*; import javax.sevlet.*; import javax.servlet.http.*; public class ser extends HttpServlet {
1
by: webster5u | last post by:
Hi, who's has experience to open connection pool in Tomcat 5.5 using JNDI? I recently research on it, i found the how-to guideline provided from apache tomcat website. It seem like not really work...
3
by: peter peterson | last post by:
I have been looking at memory pools and was wondering what would be wrong with creating a singleton which create a "pool" of (allocated) pointers to a given struct/class( in the case below Messages...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.