Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection reset by peer

 
AmitKumar Kumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Murali Mohan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While u r accessing the server, if it is restarted, the exception will be raised.
 
AmitKumar Kumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kumar,
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,
Avi.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic