This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Connection reset by peer error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connection reset by peer error" Watch "Connection reset by peer error" New topic
Author

Connection reset by peer error

Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
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


SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection reset by peer error
 
Similar Threads
Having troubles with Tomcat
hotmail and chrome
Connection reset by peer ...
Browser navigation
URLConnection timeout