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 ...
Get ASP.NET Site Performance Secrets now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.