O'Reilly logo

COM+ Programming with Visual Basic by Jose Mojica

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Declarative Transactions

As you know, a number of COM+ features can be set through declarative attributes. One is setting transactions at the component level, known as declarative transactions. You can set the transactioning attribute of each component by using the component’s Transactions tab in the Component Services administration program. The options are Disabled, Not Supported, Supported, Required, and Requires New. Through this declarative property, components decide whether they wish to participate in the outcome of the transaction. Every object that wants to participate in a transaction has one vote. All operations that the object performs occur during a transaction. At the end of the operation, all the votes are collected. Then the system either aborts the transaction or commits the transaction. You have to know when the transaction begins, when the transaction ends, what objects participate in the transaction, and how the components vote on the outcome of the transaction.

Declarative transactions differ from local transactions in several ways. First, when you use declarative transactions, you do not call BeginTrans, CommitTrans, or RollbackTrans. Your code never manages the physical transaction directly. You specify the transactional requirements of your component through declarative properties. COM+ will begin the physical transaction when needed. Your code will simply vote on the outcome of the transaction. At the end, COM+ will collect all the votes and call CommitTrans ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required