Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Problem with MySql Connections in servlet application

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am having a problem in tomcat, i am getting the below connection error.
I have my max connections set to 300 and when i check the connections in MYSql admin it only shows 27 connections.

I am using connection pooling. I have supplied the code below that i use in my application that pertains to this issue.

Is there a better way to handle the connections than what i am doing.

This is all in a simple servlet/jsp application



Connection pool


all my data classes look like this


Utility class



tomcat configuration

 
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Just curious to know if there is any reason you are not using commons DBCP connection pool ?
Regards,
Amit
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

amit punekar wrote:Hi,
Just curious to know if there is any reason you are not using commons DBCP connection pool ?
Regards,
Amit



I never knew of this. What are the advantages of it?
 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Advantages as in you get basic connection pool ready that can be easily configured for Tomcat.
I had written one entry on configuring the connection pool in tomcat.
Here is the entry, hope that helps you.

Regds,
Amit
 
Willie Smits can speak 40 languages. This tiny ad can speak only one:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic