• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 144
  • Last Modified:

1000 Point Question - VB.NET Transactions, COM+

1 Solution
You need to inherit your class from System.EnterpriseServices.ServicedComponent as well. Then I normally place Transaction(TransactionOption.Required) as an attribute at the top of the class, and I generally specify the COM+ application details in the AssemblyInfo file as:

[assembly: ApplicationName("<<app name>>")]
[assembly: ApplicationID("<<app guid>>")]

Personally, I find the quickest way to generate a GUID to use is SELECT NEWID() in SQL Server, but there are other methods of course. Both the class files and the AssemblyInfo file will need a reference:

Imports System.EnterpriseServices

You might also want to check out the AutoCopmleteAttribute class - you can flag your methods with the [AutoComplete] attribute to have them automatically determine transaction outcome based on the detection of any errors.

In answer to your question about both rolling back, it rather depends on how good your CRM is for the FileSystem. In theory, yes. I'd suggest trying it and seeing.

Featured Post

Industry Leaders: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now