O'Reilly logo

ASP.NET Site Performance Secrets by Matt Perdeck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Asynchronous data access layer

You'll find the code for the asynchronous data access layer in the downloaded code bundle, in the folder ThreadStarvation_Db_Async. A synchronous version is in folder ThreadStarvation_Db_Sync. Use the SQL scripts tuneup.database.sql and book.table.sql to create the database and books table used in the code. Don't forget to modify the connection string in web.config so that it uses your database server.

Usage

To keep it simple, the asynchronous data layer will access one database table containing books, and it will support only one method, which gets a book by its bookId. Given the overall structure, it should be easy to extend this layer and modify it for your own needs.

Don't forget to set Async="true" and set AsyncTimeout ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required