Avatar of jasonabarnett
jasonabarnett
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

COM+ Component Transaction Isolation Level

Dear Experts,

I have a number of VBScripts to manage the COM+ components in an application upgrade.  I have a script to add new components from a folder of DLL's.  The final piece of my install is to set the TXIsolationLevel of the components.

Please see the attached.  If anyone can get this snippet of code to work I'll be over the moon.

The WScript.Arguments.Item(0) is passed in from the command line as the name of my COM+ application.  The iteration through the components works however the syntax for setting the isolation level isn't right.

Many thanks in advance,

Jason
Dim oCatalog, oApplications, oApp, oComps, oComponent, i

Set oCatalog = CreateObject("ComAdmin.COMAdminCatalog")
Set oApplications = oCatalog.GetCollection("Applications")

oApplications.Populate

For Each oApp In oApplications
	If oApp.Name = WScript.Arguments.Item(0) Then
		Set oComps = oApplications.GetCollection("Components", oApp.value("ID"))
		oComps.Populate
		For i = oComps.Count -1 To 0 Step -1
			Set oComponent = oComps.Item(i)
			oComponent.Value("TXIsolationLevel") = COMAdminTxIsolationLevelReadCommitted
		Next
		oComps.SaveChanges
	End If
Next

oApplications.SaveChanges

Open in new window

VB Script

Avatar of undefined
Last Comment
jasonabarnett

8/22/2022 - Mon