File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connection hangs

 
Peter Straw
Ranch Hand
Posts: 79
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a servlet that connects to a database no problem when tomcat has been recently re-started, but after some time has elapsed, even if there aren't any users on the system, it takes a very long time to get a connection object and eventually just fails completely. Does anyone know what this might be please? Or suggest ways I might be able to de-bug the problem. I'm using tomcat4 on linux, the database is on a remote box from the webapp
Many thanks.
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
are you closing and releasing your connections ?? Maybe you should use a connection pool (of your container or some free) to handle your connections and don't do that directly in your servlet.
 
Peter Straw
Ranch Hand
Posts: 79
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes I'm closing the ResultSet, Statement and Connections. I'm using the dbcp connection pool from the Jakarta Commons package but I'm not sure that it's a problem with the pool as it happens on another site I'm writing that doesn't use pooling.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic