• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
  • Frits Walraven
  • fred rosenberger
  • salvin francis

Connection polling issue with MySQLNonTransientConnectionException and Java webapp?

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

I have a Java, JSP and MySQL application running under Apache Tomcat 6.0.26 which I've been testing with JMeter. What I find is that for a simple test having 10 users logging in and displaying a JSP which is populated from several database reads is fine.

But when I increase the number of users in JMeter to 20+, logging in starts to fail with HTTP request 500. Checking the logs I find that I am getting large numbers of MySQLNonTransientConnectionExceptions as follows:

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

So this indicates that there's an issue either with the connection polling through Apache Tomcat 6.0.26 or MySQL Community Server 5.X.

The relevant part of the application's context.xml file in the project reads as follows:

I've set maxActive above to -1 on the understanding that this is unlimited. I think that the MySQL error is because MySQL is refusing the connections.

Am I correct here? Can anyone suggest a workaround?

Typically, my database operations are as follows:

And there can be quite a few of these per page.



You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic