Thread or Web Service Callback

G

Guest

Hi,

I have to create a web page in .net 1.1 having controls whose actions are
performed through AJAX, means user can do operation without any post back. In
back end I defined a Ajax method which is called every time whenever a hit is
made.

This method invokes a web method resides in Web Service. However I've some
confusion in which one is better:

1. Make Asynchronous call through web service and in callback access its
result.
2. Create an independent thread for every call and assign a method to this
thread and access result after the completion of thread.

However I experimented on both of the approaches and found some conclusions
on it.

a) Making Async calls through web service may cause some threads to loose
their callbacks they donot reach to their callback methods, specially when
web service is performing heavy operation.
b) Transport exception is common.
c) Using an individual thread for every operation might cause session vars
to loose their values. If user makes a hit for a Ajax method concurrently 30
or more times and the method is updation values in session.
d) DO NOT know how many maximum number of threads I can open in ASP.NET
application. Hope their must be some limitation. Although I succeded upto 80
threads...

Please suggest...
Abhishek
 
K

Kevin Spencer

Personally, I think using Asynchronous calls to web services is the way to
go. Just as in any other internet-dependent application, you only need to
implement a timeout mechanism, and possibly a retry mechanism.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
G

Guest

ya, async calls to web service is cool, but If i suggest for thread pool
approach where all the requests are queued into the collection and pick an
item and process it. Approach here I used because almost queries will take
same processing time and somehow process is under our control.

What do you think?

Regards,
Abhishek
 

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

Top