locked
maxconnection and ado.net data services RRS feed

  • Question

  • We are not using AZURE, but have an ado.net data service on our hosted server. A windows dektop .NET 3.5ap1 app makes calls via linq to entities to extract a row or two from a sql server database. All our clients until this altest one have been fine. This client gets the error below from the ado.net service layers.

    Question: do I need to include and set maxconnection in teh client app app.config, or the ado.net server data service web.config?

    <system.net> 

          <connectionManagement> 

            <add address = "*" maxconnection = "48" /> 

          </connectionManagement> 

       </system.net> 

    =====================================

    System.Net.WebException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

       at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)

       at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

       --- End of inner exception stack trace ---

       at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

       at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)

       at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)

       --- End of inner exception stack trace ---

       at System.Net.HttpWebRequest.GetResponse()

       at System.Data.Services.Client.DataServiceContext.SaveAsyncResult.BeginNextChange(Boolean replaceOnUpdate)

    • Moved by Yi-Lun Luo Friday, April 30, 2010 1:04 AM Off Topic. (From:Windows Azure)
    Thursday, April 29, 2010 3:00 PM

All replies

  • This is may not be the right place for ADO.NET Data service queries, and may not get right answers, Please post it on the WCF Data Services forum http://social.msdn.microsoft.com/forums/en-US/adodotnetdataservices/threads/

    Thanks,

    Siva

    Thursday, April 29, 2010 7:39 PM
  • As Sivakumar indicated, please ask pure WCF Data Services questions on this forum. Just to provide some information, there can be a lot of causes to this issue. I suggest you to turn on WCF tracing on the services side. This can help you to trouble shoot the issue.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, April 30, 2010 1:16 AM
  • If the connection is being closed by the WCF layer itself, then tracing may provide useful information, but if it is being closed by the Data Services runtime, then it may not.

    Could you try using a tool like Fiddler (http://fiddlertool.com) to capture the request being sent to the server by the client? Its not really clear why the connection is being closed, but it may be an error and not because there are too many connections. The code that is making the call to DataServiceContext.SaveChanges (which I assume is the call being made) would also be helpful.

    Are you seeing this error when you have many concurrent requests in flight, or with a single request? It does not seem like you would need to modify the configuration if it is happening with a single request.


    Matt Meehan, WCF Data Services (Astoria)
    Friday, April 30, 2010 1:58 AM
    Moderator