Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with MySql Connections in servlet application

 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • 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

 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic