Component Services and the Distributed Transaction Coordinator

[Previous] [Next]

Earlier we presented a fairly simple example of a necessary transaction—the transfer of money from one account to another. Writing code to manage units of work on different databases in a single transaction is much more complex—unless you use Component Services (formerly named Microsoft Transaction Server).

Component Services uses a two-phase commit process to manage transactions across multiple databases. The standard example of a two-phase commit is a wedding ceremony. The minister asks both the bride and the groom if they do. If either party says that they don't, the marriage is off. That sounds simple enough. Now imagine that the wedding takes place over a transcontinental conference call, and the first party is cut off just after saying "I do" and before hearing the other party's response. At least one party doesn't know if he or she is married, which leaves the transaction incomplete.

If you're writing code to communicate to different database systems across a wide area network, you could have a similar problem. Imagine the code you would have to write to handle a transaction during which one database gets disconnected from another. Chances are, after you've written the code to manage that scenario once, you'd be able to reuse that code in your other applications.

The Component Services team has already written some of that code for you. They laid the groundwork, but they still can't know how to actually manage a specific database system's transactions. A database must support the two-phase commit protocol in order to support Component Services transactions. SQL Server 6.5 and later, as well as Oracle 7.3 and later, support Component Services transactions. Access databases and most other desktop databases (Microsoft FoxPro, Corel Paradox, Inprise dBase, and Pervasive Btrieve) do not.

Even if you're not going to use the Component Services transactional capabilities, you might want to use this service to manage your business objects if you're building a multitiered application.

If you want more information on Component Services, there are other books that cover Component Services (and Microsoft Transaction Server) in much more depth.



Programming ADO
Programming MicrosoftВ® ADO.NET 2.0 Core Reference
ISBN: B002ECEFQM
EAN: N/A
Year: 2000
Pages: 131
Authors: David Sceppa

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net