This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Servlet with connection to database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Servlet with connection to database" Watch "Servlet with connection to database" New topic
Author

Servlet with connection to database

Thomas Sutton
Greenhorn

Joined: Feb 18, 2013
Posts: 3
I have been load testing our code which takes a request from the website performs some checking then updates a db2 database table. We are using a jdbc connection pool and everything is fine until I increased the number of requests to around 3 per second. Then we start to see some strange behaviour. Connections to the db seem to be closed by themselves, connection.close() is not called on the connections that have closed prematurely I'm sure of that. I have checked through the code several times and can't find a reason for this. Does this point to a problem with the jdbc connection pool or the database itself?

Thanks
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3749
    
  10

Are you closing the connections yourself? Just because it's in a pool, doesn't mean you shouldn't close every connection in a finally block.


[OCA 8 Book] [Blog]
 
jQuery in Action, 3rd edition
 
subject: Servlet with connection to database
 
It's not a secret anymore!