?
Solved

slight confused...about com+ services

Posted on 2005-05-15
2
Medium Priority
?
242 Views
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 work...am 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 means...it 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 appreciated.....ca you give me some documentation on this which clearly explains this....

thanks
rinks
0
Comment
Question by:rinksno1
1 Comment
 
LVL 18

Accepted Solution

by:
mdougan earned 150 total points
ID: 14011010
Hi,

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:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cossdk/html/e2198514-c403-4b31-8c8c-0b1c83c4f936.asp

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.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

807 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