Win a copy of The Java Performance Companion this week in the Performance 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
Marshal
Posts: 34671
367
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
Marshal
Posts: 34671
367
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic