It's basically the same thing as when you use a non-COM+-aware COM component. You wind up running in the same context because you haven't done anything to tell the system to force you into a different one.
The data access stuff (e.g. ADO) actually relies on this. All it does is look around, figure out if it's in a transactional context (i.e. its caller was in a transactional context) and then enlists if so. All this is explained in the very excellent "Transactional COM+" by Tim Ewald. I can't recommend it enough to anyone working with COM+ - you seriously must read it. > -----Original Message----- > From: Moderated discussion of advanced .NET topics. [mailto:ADVANCED- > [EMAIL PROTECTED]] On Behalf Of Matthew > Sent: Sunday, June 23, 2002 2:02 PM > To: [EMAIL PROTECTED] > Subject: [ADVANCED-DOTNET] COM+ web service transaction > > I used the EnableTransaction property of the WebMethod attribute to run a > web method inside a COM+ transaction. I then call a database component to > perform an operation, and try to write a file. Happily, if the file > operation fails, the database task is rolled back. > > However, after I implemented this solution I started to wonder. My > database component is an ordinary .NET class in a separate assembly. Why > can it run inside the same transaction? Wouldn't it need to be a serviced > component that has the EnableTransaction setting? > > In short, my code works, but I'm wondering *why*. > > > Matthew > > You can read messages from the Advanced DOTNET archive, unsubscribe from > Advanced DOTNET, or > subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.