MARS, Asynchronous Commands, and ObjectSpaces
The data access classes introduced into ADO.NET version 1.0 and the techniques for using them are aimed at the needs of modern applications—in particular the two distinct requirements that these applications encounter. The first is to be able to operate in a disconnected environment, where data needs to be remoted to clients across a network. The second is to provide fast, simple, and clean access to data in read-only fashion for populating controls and other data consumers.
However, there will always be many more specific scenarios in which your code will operate. To provide more opportunities for extracting better performance from your applications and to add new features that have been requested by users, ADO.NET version 2.0 supports some new approaches to accessing and updating data. The features we'll be covering in this chapter include the following:
Multiple Active Results Sets (MARS), which provide the opportunity to open more than one results set over the same connection and access them concurrently Asynchronous access to the results of multiple commands over the same Connection instance, plus the ability to open connections asynchronously The new ObjectSpaces technology added to ADO.NET, which allows data to be defined as instances of a class but handled just like other intrinsic data types
The first two of these topics are related in that the ability to execute multiple commands asynchronously and to have more than one set of results active over the same connection provides huge opportunities for increasing performance when complex multiquery processes are required. We start this chapter with an overview of these two technologies and how they fit in with the existing data access capabilities of ADO.NET.
 |