Async WS not working well

K

Kenny M.

Hi

I'm receiving Data from 20 clients around the city and updating my SQLServer
DB
via an Async WS

I'm using DialUp 56kb on each client

The process:

1. I create a text file
2. I wrote the data to the Text File (Serial and amount)
3. I read the Text File
4. put the content into a string Var
5. Pass the string var into the Async WS method
6. Delete the file
again

The Problem:
Records are being duplicated on the DB

When I switch to the Sync WS everything is fine!

Any sug about this behavior
 
D

Dan Rogers

Hi Kenny,

Where are the duplicates coming from? Is the same request being made by
the same client, over and over (replay issue)? or are the duplicates coming
from different clients coming up with the same data (concurrency control
issue)?

How are you createing an Asynchronous method? Asynchronous is a
much-misunderstood term that often means both "called with no client side
wait" and "fire and forget". The automatic proxies allow the first
approach to be done by calling BeginXXMethod on the client side. Another
way to make this happen is to make the method a one-way method by
attributing the void method on the server side as one-way. Which is it in
your case?

In either case, it is the designers responsibility to make sure that a
multi-user, multi-location client-server system is immune to replay issues
(some call these inadvertent attacks). Typically, each request is
accompanied by a serial number that is unique to each caller or is globally
unique. The server side takes the responsibility for ignoring requests
that have already been made (and optionally returning the original response
- strongly recommended).

For concurrency related issues, the server/clients protocol must include
elements that allow you to distinguish overlapping requests to update or
add the same item, and rejecting all but the first one. Alternately, the
protocol should provide a voluntary locking mechanism that lets a caller
request permission to update/add something, perform the add, and then
release the lock. Locks typically have a time limit so they can
auto-expire.

None of these come for free when you say "one-way" - you have to plan on
some means for providing these abilities/checks/preventions when you build
a multi-client/multi-location distributed system.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top