File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Connection reset by peer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Connection reset by peer" Watch "Connection reset by peer" New topic

Connection reset by peer

AmitKumar Kumar

Joined: May 13, 2005
Posts: 2
I have an application where i am using database connection through Driver Manager i.e. i am not using any Connection pool.
The application performs database operation like selecting data from a table and then update another table .
This program run randomly undergo following error :-
java.sql.SQLException: Connection reset by peer: JVM_recv in socket input stream read

In order to solve it i have taken the following actions
(a) I used the connection pool using Weblogic 7.0.
When i run the program it gave me the following error :
"out of Memory Error"

Hence i increased the heap size of Weblogic 7.0 by updating the
startWLS.cmd .
Here i updated the following variable :
set MEM_ARGS=-Xms512m -Xmx512m

But after implementing this it is still giving me the "out of Memory Error"

I know again switched back with my origanal code that is Connecting through Driver manager.

Can anaybody help me and suggest how can i resolve this problem.
thanks in advance.
Sharma Ashutosh

Joined: Apr 06, 2001
Posts: 346
U might me trying to use the same connection object to create statement and somewhere it is being closed or some of it's constituents has been closed.

Ashutosh Sharma
SCJP 1.2, SCEA 5, Brainbench certified J2EE Developer, Documentum Certified Professional
Blog :
Murali Mohan
Ranch Hand

Joined: Jul 07, 2003
Posts: 47
While u r accessing the server, if it is restarted, the exception will be raised.
AmitKumar Kumar

Joined: May 13, 2005
Posts: 2
Thanks for the reply.

But if the Statement is closed anywhere how the program works properly most of the time.I mean to say if i excute this program for 10 times it works fine for 8 times .Infact in the development environment it has never failed .It is happening only in production server.
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1141

An "OutOfMemoryError" usually indicates a memory leak in your application. The usual way to locate the cause of a memory leak is to use a profiler. For your information, the JavaPerformanceTuning Web site has a lot of information on profilers for java applications.

Good Luck,
I agree. Here's the link:
subject: Connection reset by peer
jQuery in Action, 3rd edition