Click here to Skip to main content
15,346,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have developed webservice using .NET 2.0.This is scheduled job. In this webservice i am calling third party database.
The third party database returns the data through typed dataset,
The web service is calling in console project(.exe file).
The console project deployed sql server agent in sql server 2005 management studio.
if data is very high(in lakhs) and the job will be continue up to 4 to 5 hours and job is failing then
i am getting following error.

System.IO.IOException: Unable to read data from the transport connection. ---> System.Net.Sockets.SocketException:
An existing connection was forcibly closed by the remote host

if data is very less then it works properly.this thing happening only on production server.
same if i debug on local machine then it is working perfectly fine without any error.

please give me solution for same.

Thanks in advance
Posted
Updated 1-Apr-22 21:49pm

1 solution

Leaving a connection open any longer than absolutely necessary is a bad idea.

You probably should refactor your code so that the job is kicked off by the service, and the service method terminates. At that point, you can either have the remote host contact your machhine via WCF (or TCP) when the job is done, and then your app can retrieve the data.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900