Solved

sql java errors

Posted on 2013-10-25
5
863 Views
Last Modified: 2013-11-06
when error log says both sql and java in the same line, how can we troubleshoot where the problem is.. this happens once in a few days...
0
Comment
Question by:25112
5 Comments
 
LVL 5

Author Comment

by:25112
ID: 39601109
here is an example:
com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset by peer: socket write error
               at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1368)
               at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1355)
               at com.microsoft.sqlserver.jdbc.TDSChannel.write(IOBuffer.java:1548)
               at com.microsoft.sqlserver.jdbc.TDSWriter.flush(IOBuffer.java:2368)
               at com.microsoft.sqlserver.jdbc.TDSWriter.writePacket(IOBuffer.java:2270)
               at com.microsoft.sqlserver.jdbc.TDSWriter.endMessage(IOBuffer.java:1877)
               at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:4403)
               at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:386)
               at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:338)
               at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4026)
               at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1416)
               at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:185)
               at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:160)
               at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:281)
               at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
               at java.lang.Thread.run(Thread.java:662)
0
 
LVL 20

Assisted Solution

by:Amitkumar Panchal
Amitkumar Panchal earned 167 total points
ID: 39604058
This seems to be a network issue at first look. This occurs even network is down for a second.

However, there are many reasons... like..
1. network issue
2. connection timeout
3. application lost a connection
....
so on.
0
 
LVL 28

Assisted Solution

by:Naveen Kumar
Naveen Kumar earned 166 total points
ID: 39607622
May be you can get to the bottom of the problem by running your app/code in the debugging/log mode to let you know at what point it throws the below error and then go from there to see what can be done to fix it.

Thanks,
0
 
LVL 35

Accepted Solution

by:
mccarl earned 167 total points
ID: 39607659
Can you show how you are configuring your DataSource? From the error I gather you are using c3p0 for pooling data sources. The error that you are getting is probably from SQL Server closing connections after a certain period of idle time. You should be able to configure c3p0 to test connections periodically so that the server doesn't time them out, or other similar configurations to overcome this type of problem.

Post your config and we should be able to assist.
0
 
LVL 5

Author Comment

by:25112
ID: 39627649
your clues have helped me. thanks.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article describes some very basic things about SQL Server filegroups.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now