Results 1 to 4 of 4
  1. #1
    shuvra_pan is offline Member
    Join Date
    Jun 2008
    Posts
    10
    Rep Power
    0

    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...

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    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.

  3. #3
    shuvra_pan is offline Member
    Join Date
    Jun 2008
    Posts
    10
    Rep Power
    0

    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...

  4. #4
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    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.

Similar Threads

  1. small problem in connection
    By BsBs in forum CLDC and MIDP
    Replies: 1
    Last Post: 01-27-2009, 06:03 AM
  2. jdbc connection problem
    By Assaf A in forum JDBC
    Replies: 0
    Last Post: 12-01-2008, 05:08 PM
  3. connection problem
    By subash in forum JDBC
    Replies: 5
    Last Post: 04-22-2008, 09:17 AM
  4. Sql server connection problem
    By tanvirtonu in forum JDBC
    Replies: 1
    Last Post: 03-31-2008, 12:46 PM
  5. Java Serevr Connection Problem
    By virendra_agarwal in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 12-19-2007, 12:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •