Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Instancing of Com+ classes

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi all,

I have two classes named ClsA and ClsB which are in the same VB project
(dll). The Instancing of ClsA is MultiUse and its MTSTransactionMode is
RequireNew while ClsB's instancing is Private. Since ClsB is a private
class, MTSTransactionMode cannot be set. It is set to private in order to
avoid other dlls or exes use it.

ClsA will use new to create ClsB instance. The ClsB instance will then add
a record to Database(SQL server).

I import this dll into COM+. Only ClsA can be seen in the Com+ console. I
use vb client to create instance of ClsA and ClsA creates instance of ClsB.
It seems to work fine. The transaction can be setComplete(Commit) or
setAbort(Rollback).

My question: Is it ok for me to have such com+ dll with some classes are
multiuse while some are private?
Any concerns or drawbacks i have to pay attention to?

Thanks alot!


 
Good doubt. I have the same. In fact I have a DLL that has some 10 classes (some of which are collection classes and some are just normal classes that are subclasses in a hierarchy).
Now in my case So far i have just kept my DLL without any transactional functionality but very soon I will have to.

And i am sure this is the doubt that I will have as to which classes to set the attributes for.

someone please help.

Thanks

T.O.
 
Hi,
When you mind classes you are talking about com+ components? If so, i guess you have 1 com+ component that have inside a call to a class, inside the component, if you do not call another com componentes o use coinitialize to change the working model of com or create threads you should stay inside of your transactional model and in the current com+ activity.
You can easily prove it, save something with Ca, then call Cb and save something, then abort the transaction (SetAbort). If nothing was saved it's ok, in any other way yau have some problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top