You can use the MTS Explorer to configure transaction support for a component. Right click the component, select Properties then the Transaction tab.
You can also set the default value for a component's transaction setting in VB. The class module has a MTSTransactionMode property. When compiled, VB will place a constant in the object's type library. When a component is added to a MTS package, MTS reads the type library and uses that transaction setting.
MTS doesn't read the type library when components are added from the registered component list, only when added to a package with the Add File dialog. If from the registered components list then you have to configure transaction support manually in MTS Explorer.
Saad -
You might also make sure you really need COM+ transactions. These are actually DTC (Distributed Transaction Coordinator) events, and are very expensive in terms of system resources. The only time you should need one is when multiple resource managers are involved. A resource would be something like SQL Server, DB/2, MSMQ, or MQSeries.
So if you need data positively written to SQL Server *and* MSMQ, or SQL Server *and* DB/2 then use DTC (aka COM+ transactions). It uses a two-phase commit to make sure that both resources are prepared to write the data. Once both resources indicate they're ready to write, DTC will tell them to proceed. If either of the resources is not ready, then the transaction will be rolled back.
If you only need data written to SQL Server by itself, or DB/2 by itself, then ADO transactions are your best bet. For MSMQ or MQSeries, use a transactional queue, as your data will be written to the message store before being processed, thus ensuring it will get through (non-transactional messages only stay in RAM, can can be lost during a power failure or reboot).
Chip H.
If you want to get the best response to a question, please check out FAQ222-2244 first
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.