Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6024661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:11:16+00:00 2026-05-23T04:11:16+00:00

I have a client/service. The service has a method that takes a long time

  • 0

I have a client/service.

The service has a method that takes a long time to do (it interacts with a database).

I’m call this method via a AJAX request from the page to the client, then to the service and back.

My service code:

[WebMethod]
public static string LookupUPC(string sessionId, string upc) {
    string response = "";
    var client = new SmartShopService.SmartShopInterfaceClient();
    try {
        response = client.LookupUPC(sessionId, upc);
    }
    catch (Exception e) {
        throw e;
    }
    finally {
        if (client.State == System.ServiceModel.CommunicationState.Faulted)
            client.Abort();
        else
            client.Close();
    }
    return response;
}

It is called from the page by an AJAX request

for(var i = 0;i<10; i++){
$.ajax({
    type: "POST",
    url: "SmartShopGUI.aspx/LookupUPC",
    contentType: "application/json; charset=utf-8",
    data: DataCreator(allData),
    dataType: "json",
    success: function (result) {
        $(upcName).html(result.d);      
    },
    error: AjaxFailed
});
}

Now, this is done asynchronously on the page, but the client is sending the requests synchronously. I want to change it so that if it asks for 10 all at once, it’ll send 10 different requests to the service.

http://www.screencast-o-matic.com/watch/cX1Qo8qV2

Here is a video that might help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:11:17+00:00Added an answer on May 23, 2026 at 4:11 am

    Remove the reliance on Session in the webmethod, you’ll probably find that session access is serial and that is what the block is.

    http://msdn.microsoft.com/en-us/library/ms178581.aspx

    Concurrent Requests and Session State

    Access to ASP.NET session state is
    exclusive per session, which means
    that if two different users make
    concurrent requests, access to each
    separate session is granted
    concurrently. However, if two
    concurrent requests are made for the
    same session (by using the same
    SessionID value), the first request
    gets exclusive access to the session
    information. The second request
    executes only after the first request
    is finished. (The second session can
    also get access if the exclusive lock
    on the information is freed because
    the first request exceeds the lock
    time-out.) If the EnableSessionState
    value in the @ Page directive is set
    to ReadOnly, a request for the
    read-only session information does not
    result in an exclusive lock on the
    session data. However, read-only
    requests for session data might still
    have to wait for a lock set by a
    read-write request for session data to
    clear.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .NET web-service client that has been autogenerated from a wsdl-file using
I have client application that uses WCF service to insert some data to backend
I have a Java client that calls a web service at the moment using
I have a java client program that uses mdns with service discovery to find
I have a C# application that is a client to a web service. One
In my WPF client, I have a loop that calls a WCF service to
I have a database that many different client applications (a smattering of web services,
I have a service that runs that takes a list of about 1,000,000 dictionaries
We have an application that has a WCF service (*.svc) running on IIS7 and
I have a domain service, derived from LinqToEntitiesDomainService<FOOEntities> It has one method, IQueryable<Bar> GetBar().

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.