Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

When do I have to use CreateObject and when CreateInstance?

createobject
0
Posted

When do I have to use CreateObject and when CreateInstance?

0

You have to use CreateInstance if: – You are in a component running under MTS AND the object you want to create is registered under MTS AND you want that the transaction (the activity in the most general case when no transactional objects are involved) flows from the father object to the child object. You have to use CreateObject if: – The caller hasn’t got a TransactionContext, that is, you want to instantiate the root object of a transaction from the base-client OR – The caller has got a TransactionContext but you want that the child object lives in a new different transaction (read activity in the most general case). Note that you would have achieved the same effect if you had used CreateInstance but the child object had been declared under MTS as “Requires New Transaction”.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123