Just about every business application uses data in one form or another. Some applications are concerned only with querying and analyzing data, while others are primarily concerned with modifying data. Applications that modify data and have a large number of concurrent users are commonly referred to as online transaction processing (OLTP) systems. This chapter covers this type of application.
You should understand certain things about OLTP systems before you write transactions for Microsoft Transaction Server (MTS). This chapter covers the ABCs of transaction processing. It also explains why a transaction must meet the "ACID rules" and what is meant by a transaction's isolation level.
The chapter looks at a common OLTP architecture for distributed systems that many vendors use. It explains how to assemble a reliable OLTP system using a transactional application and transaction managers when the data is spread across many servers. Special attention is given to Microsoft's version of the transaction manager, the Distributed Transaction Coordinator (DTC).
You'll also learn how MTS transactions are used to run distributed transactions in OLTP applications. MTS uses a model based on declarative transactions to leverage the facilities of the DTC while hiding many of the tedious low-level details.
Finally, you'll learn how to write transactional MTS components with Visual Basic and how to use four basic methods of the context object—DisableCommit, EnableCommit, SetComplete, and SetAbort—to control the outcome of your transactions. The chapter also delves into a variety of transaction-related topics such as deadlocks and stateless programming.