slight confused...about com+ services

Posted on 2005-05-15
Last Modified: 2010-05-18
I am slight confused. Its about com+ services..

lets say i  am using objectcontext in my VB code(ActiveX dll) i have implemented transaction through code successfully....but now what i have to do is to register my component as a COM+ service component(for transactions to i right??) finally i have my DLL as a registred Com+ comp. In component servies (windows 200) when i check the transactions tab of my com+ comp., it is showing transaction support as disable, Not supported, Supported, Required,Requires New. what does this it going to override my component transaction support which i have coded...or why do i need to code objectcontext if i can do it from this tab...and this tab has the same properties as that when you look in class properties of ActiveX Dll i.e. MTSTransactionMode...why this repetition, what does this mean..

a clear answer is you give me some documentation on this which clearly explains this....

Question by:rinksno1
    1 Comment
    LVL 18

    Accepted Solution


    It is a little confusing, and it's been a few years since I've worked with it, so, you'd best read through the documentation yourself for the best understanding of how it all works:

    However, from what I remember, the issue is that regardless of what you've coded in your component, COM+ automatically manages transactions through it's Distributed Transaction Coordinator (DTC).  The selections on the tab tell DTC how to manage those automatic transactions for your particular component.  For example, DTC will automatically start a transaction whenever you call a component that is defined as "Requires" transaction (if no transaction currently exists) or always whenever "Requires New" is declared.

    Now, if you didn't care about controlling your transactions at all, you could skip doing any coding for GetObjectContext.SetComplete or SetAbort (I believe) and the DTC is going to automatically commit or abort your transaction if there is not, or is a runtime error respectively... but, most people want to code their own coditions where they will commit (SetComplete) or rollback (SetAbort) the transaction.

    Our general rule for developing COM+ components was to have two different classes as part of each component... the read-only interface would be declared as Uses Transactions, the update interface would Require Transaction.  In the Read Only class we wouldn't code any GetObjectContext.SetComplete or SetAbort, but in the class used for updating, every single method would perform either a SetComplete or SetAbort.  This gave us complete control over managing transactions (included nested transactions where one update object might call another update object) in our update class.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now