PRB: SQL Server CE Connectivity Application Stops Responding When Network Connection is Dropped (285865)



The information in this article applies to:

  • Microsoft SQL Server 2000 Windows CE Edition

This article was previously published under Q285865

SYMPTOMS

When a network connection is dropped, a SQL Server CE connectivity application (Replication or Remote Data Access [RDA]) stops responding for approximately 5 minutes before returning an error message

CAUSE

If there is no network connectivity, SQL Server CE Replication or RDA methods test for a connection for 5 minutes before returning an error message.

RESOLUTION

Use an alternate method to determine if the device has network connectivity before you call the RDA or Replication methods.

The Microsoft SQL Server 2000 Windows CE Edition version 1.1 release introduces SSCERelay technology that allows an RDA or Replication application to connect to a Microsoft Internet Information Server (IIS) server through an ActiveSync connection to the desktop.

MORE INFORMATION

In the current design of SQL Server CE, after a call to Replication or RDA occurs, if a network connection is not present, SQL Server CE tests for a connection for the next 5 minutes before returning an error message.

After the first connection is made, if connectivity is dropped in the middle, for next 5 minutes SQL Server CE keeps trying the connection without returning an error message to the user. This is an example of a mobile device disconnected scenario in which the SQL Server CE application would like to retry and complete the synchronization process as soon as connectivity is established. You can compare this to a cell phone scenario in which the cell phone goes out of range in an area and then comes back in range to provide service.

The application can programmatically test if there is a network connection from the operating system before attempting to initiate the RDA or Replication methods on the device. Depending on what connectivity solution the device is using, there are ways to determine from the operating system if the network connection is present.

One way to determine if a network connection is present is to call the gethostbyname function and look at the addresses that are returned.

The following Microsoft Knowledge Base article describes a related technique:

301089 HOW TO: Find the IP Address of a CE Device Connected Through RAS to a Windows NT Server

Another solution is to try to ping the server URL from the device before you try to invoke Replication or RDA methods.

Steps to Reproduce Behavior

Run a sample Replication or RDA application and remove the network connectivity. When a method is called to connect to SQL Server, the application stops responding for about approximately 5 minutes, and then reports this error message:

Source: Microsoft SQL Server 2000 Windows CE Edition
Error Number: 80072EFD
Native Number: 28037
Error Description: Run
HttpSendRequest failed. hresult has more detail
SSCE_M_HTTPSENDREQUESTFAILED

Modification Type:MajorLast Reviewed:2/25/2002
Keywords:kbDSupport kbprb KB285865