Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
public void computeABC()
        {
           /*this is dummy code  , computeA(),computeB(),computeC() needs to be called asynchronously  the result of this fuctions will be input to computeResult() */


            objMyClassA = computeA(); //
            objMyClassB = computeB();
            objMyClassC = computeC();

            computeResult(objMyClassA, objMyClassB, objMyClassC);

        }

public MyClassA  computeA ()
{

     /* database call */
}
public MyClassB  computeB ()
{

    /* database call */
}
public MyClassC  computeC ()
{

    /*database call */
}
Posted
Comments
mahadevkarekar 25-Feb-15 2:01am    
As seen in code i have 3 methods . computeA() ,computeB() ,computeC(). all this 3 methods perform heavy database operations. so i need to call all this 3 method at one time.
Tomas Takac 25-Feb-15 4:52am    
Sounds like this is ideal scenario for async-await[^].
sashje- 25-Feb-15 5:17am    
Since mentioning ASP.NET as a tag, i suggest you perform this out-of-process of IIS. If the processing takes more that 30 seconds, i guess clients would suffer a timeout.
My suggestion is to start the process from asp.net by pushing the request to a MSMQ queue, have a windows service pick it up, store the result in db, and in ASP.Net have a updatepanel with a timer which checks for the result of the process.

if MSMQ and a windows service is out of the question, i guess you could start a backgroundworkerthread in your global.asax instead, and pickup the result using updatepanel + timer..

If you still need to do this in ASP.NET 3.5, you can set the .aspx page to be Async="true" with an appropriate AsyncTimeout and then create
System.Web.UI.PageAsyncTask objects to do the async work..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900