mase posted on Monday, July 23, 2007
I have a few questions around how CSLA works with ASP.NET to acheive asynchronous database calls. I don't see much discussion about asynchronous on these forums or in the C# book. So here are a few questions around setting this up.
I have an extensive ASP.NET web app that uses 80+ business objects. There are ways to setup asynchronous pages in ASP.NET, but it seems to make more sense for us to set this up on each fetch method in the business layer, as this could then apply to each DB call from the UI.
- Does the page directive "async=true" need to be put on all the pages in order for this to work?
- When the asynchronous operation occurs, will it truly release the thread that ASP.NET is using to build the page?
- I'm not convinced this becomes totally asynchronous since the page will still execute synchronously until it reaches the CSLA framework where the database call is made?
- Is it a smarter approach to setup this up on the page level rather than the business layer?
- Does RegisterAsyncTask need to be used on the page in order to make the database call asynchronous in the BO?
I'm hoping to make all or most of our database calls asynchronous with the least amount of code to update. Each page has several database calls and would require a very large base of code to update if I need to Asynchronize each database call on each page.
Thanks