This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Connection reset by peer error

 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi:
I am using Tomcat and SQL2k. I have a simple app. that does a simple database query. If I left my browser running for long time, then try to access the app., I got this error: [Microsoft][SQLServer 2000 Driver for JDBC]Connectin reset by peer:socket write error.
If i open a new browser window, I got the same error. It goes away only if I redeploy the application. In my web.xml, I don't have any time out parameters of any kind. Does anyone know what is going on.
thanks
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 35976
422
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hanna,
The database has a timeout and the driver probably has a timeout. Are you closing the connection in a finally block? If not, you could have a resource leak.
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Jeanne:
Yes I am closing all of my JDBC resources in a finally block after each query. What is driver timeout? When I open a new window, I got the same error message. If my session timeout, shouldn't a new window start a new session?
thanks
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 35976
422
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hannah,
After a certain amount of time passes, the driver kills the connection. This helps prevent deadlocks.
When you open a new window, you get a new http session. If you are using connection pooling, the database error could be independent of the session.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!