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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I just want to be sure

Status
Not open for further replies.
Sep 17, 2002
3
TR
I am trying to be sure on the following things about MTS, please help me.

- Question 1:
Is IObjectContext.SafeRef method obscure on COM+ ?

- Question 2:
Is IObjectContext.CreateInstance method obscure on COM+ ?

- Question 3:
Let's suppose that we have two components which have "Requires a Transaction" property on their transaction types. Those components is not aware from each other and someday it is required to come those components together in a transaction. In COM+, in such a case, will it be required for the baseclient to create the second object with using the first object's objectContext? This means:

Dim ObjContext As ObjectContext
Dim Obj1 As Component1.ObjectX
Dim Obj2 As Component2.ObjectX

Set Obj1 = CreateObject("Component1.ObjectX")
Set ObjContext = Obj1.GetObjectContext()

Set Obj2 = ObjContext.CreateInstance("Component2.ObjectY")

Obj1.AMethod();
Obj2.AMethod();

'Clean Up
' ..
^-- is this required ?

Or should I use ITransactionContext ? In a distrubuted environment, can this work ?

- Question 4:
In COM+, does IObjectControl.CanBePooled() method work ? I am asking this because in MTS this feature was not actually working, it just was an empty method.

- Question 5:
I'm developing a ASP, VB, VC++ component and i am curious about that; should i return the error information to the client with err.raise ? or.. should i return just error number ? or.. should i return the value as a parameter of my function; but the last action is not recommended method as i know. because, this method doesn't work with javascript; because javascript doesn't support the argument passing..

- Question 6:
A property that will be reset in the IObjectControl.Deactivate() method; should i use this type of semi-stateful implementation ? This means, that property will be used for returning the data; it is not for holding data between component calls, this is why i call such an implementation as semi-stateful.

Thank you very much.
Best Regards.
 
1)SafeRef is opsolete (spelling) in COM+ (if this is what you mean by obscure)
2)in COM+ CreateObject and CreateInstance do the same thing so you don't have to use it but it is there for backward compatibility
In COM+ you don't need the ObjectContext to execute CreateObject either.
3) Requires a Transaction will create a transaction if needed but will use the callers transaction if it exsists.
4)CanBePooled was not paid attention to for apartment threaded model components but it was for components marked Both under MTS. If you use this make sure your activate and deactivate methods are water tight or state information will slip through
5)I always raise actual errors. Business Rule errors can then be handled via normal error catching.
6)Initialization of a variable in a object should always be in the Activate. Because if it isn't it will not be there for the first call. So I'm unclear what you are saying.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top