Perhaps the most important feature in COM+ services is transactions. If you think about it, the predecessor to COM+ is Microsoft Transaction Server (MTS); the name implies that the main purpose of the product is to manage transactions.
In this chapter, you will learn about transaction services. A lot of COM+ programming has to do with concurrent data access. In large systems, a number of clients may be using the same COM+ application, and each client may be calling the same methods and accessing and modifying the same data. To guarantee that each client can change data safely, we use transactions.
A transaction in a database environment is usually defined as the movement of one or two pieces of data from one location to another in a way that guarantees their integrity. The definition of a transaction, however, is not limited to data in a database. It is also possible to involve other resources in the transaction. For example, COM+ transactions may involve MSMQ messages. (A full discussion of MSMQ—a product from Microsoft for sending and receiving messages—is beyond the scope of this book.) In order to ensure the integrity of data involved in them, transactions must meet the ACID rules. The acronym ACID stands for Atomic, Consistent, Isolated, and Durable. These terms have the following meaning:
The operation must succeed completely or be rolled back completely. In other words, it is an all or nothing operation. Atomicity ...