Solved

sql java errors

Posted on 2013-10-25
5
875 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 21

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

770 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