Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-10-2009, 02:31 PM
Member
 
Join Date: Jun 2008
Posts: 10
Rep Power: 0
shuvra_pan is on a distinguished road
Default Too many Connection Problem Plz Help
I am getting Too Many Connection error in Tomcat5.5 and mysql Database while i am simultenously browsing my web application.


plz help me out...
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 03-16-2009, 03:18 PM
Steve11235's Avatar
Senior Member
 
Join Date: Dec 2008
Posts: 972
Rep Power: 2
Steve11235 is on a distinguished road
Default
Apparently, you are opening a new database connection every time you access your servlet, and then you leave the connection open.

One option is to simply close the connection in the servlet. However, opening a connection is *very* slow, so you will probably notice it in your response time.

The second option is to pool your connections. This is not terribly hard to do, but it does require thinking through synchronization issues and making sure that all servlets release the connections after requesting them.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 03-17-2009, 08:58 AM
Member
 
Join Date: Jun 2008
Posts: 10
Rep Power: 0
shuvra_pan is on a distinguished road
Default
thanz for reply...

1st thing is that i am not using any servlet i am using only jsp pages..

plz give me the sample ,how can i messure the time that how long the connection is open.

And plz give me an example of connection pooling..........

plz plz reply soon...
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 03-17-2009, 02:42 PM
Steve11235's Avatar
Senior Member
 
Join Date: Dec 2008
Posts: 972
Rep Power: 2
Steve11235 is on a distinguished road
Default
First, JSP pages are compiled by the Web Application Server into servlets.

I don't know of a connection method that tells when it was opened.

Pooling is a somewhat advanced topic, but it is essential in a Web application server environment.

Java provides connection pooling support through JNDI (Java Naming & Directory Interface). Here's a link.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
small problem in connection BsBs CLDC and MIDP 1 01-27-2009 07:03 AM
jdbc connection problem Assaf A Database 0 12-01-2008 06:08 PM
connection problem subash Database 5 04-22-2008 10:17 AM
Sql server connection problem tanvirtonu Database 1 03-31-2008 01:46 PM
Java Serevr Connection Problem virendra_agarwal JavaServer Faces 0 12-19-2007 01:43 PM


All times are GMT +2. The time now is 10:08 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org