A Simple Transaction Example

To make it easy for you to understand what I've talked about so far, and to give you a picture of how to implement transactions in your COM+ code, I've written a very simple example. I made a point of keeping it as simple as possible so that you can easily understand the important points that relate to transactions.

The component was written in Visual C++ using ATL, and the client program was written in Visual Basic. Both can be found in the Chapter17\SimpleTrans directory on the CD-ROM.

Listing 17.1 shows you the important code from the COM+ component, and Listing 17.2 shows you the Visual Basic code for the client application. An explanation follows the code listings.

Code Listing 17.1. A Very Simple Transaction ...

Get COM+ Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.