Consider the listing of code below, which is purely
synchronous.
Listing 1 - Synchronous
SqlDataReader dr1 = com.ExecuteReader();
//Other lines of codes
SqlDataReader dr2 = com.ExecuteReader();
Synchronous means, the thread that is executing line 1 will
wait until the database operations is complete and proceed with the execution
of line 2. If the database operation is really massive, then the execution will
not proceed with the other lines of code until the massive database operation
is completed. This makes the application respond slower and the end user might
feel the application is not performing well. This degradation can be mitigated
with the new extensions of ADO.NET 2.0 which is called Asynchronous ADO.NET
commands. With this, it is possible to execute massive database operations
asynchronously in a separate thread by proceeding current execution of other lines
of code without waiting for the massive database operations to complete. We
will see this in detail in coming sections.