Solved

COM+ Component Transaction Isolation Level

Posted on 2010-11-10
4
858 Views
Last Modified: 2012-05-10
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

0
Comment
Question by:jasonabarnett
  • 3
4 Comments
 
LVL 8

Accepted Solution

by:
GundogTrainer earned 500 total points
ID: 34103722
is COMAdminTxIsolationLevelReadCommitted  a standard constant ?
have you tried setting it ti its value first

COMAdminTxIsolationLevelReadCommitted = 2
0
 

Author Comment

by:jasonabarnett
ID: 34104342
Hi GundogTrainer,

Thank you for your response.

Having kicked myself for not considering this I've updated line fifteen as follows:

oComponent.Value("TXIsolationLevel") = 2

Rather than define a constant I've explicitly defined the value.  I now get the following error:

set_component_isolation.vbs(15, 4) Microsoft VBScript runtime error: Invalid procedure call or argument

I suspect we are close but I can't see the wood for the trees here, any further advice please?

Regards,

Jason
0
 

Author Comment

by:jasonabarnett
ID: 34105134
Hi,

Building on your answer and a bit of trial and error I've resolved the issue.  TxIsolationLevel is case sensitive so my TXIsolationLevel wasn't recognised.

Working code attached for the good of humankind :).

Points to GundogTrainer for steering me in the right direction.

Regards,

Jason
Option Explicit
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") = 2
		Next
		oComps.SaveChanges
	End If
Next

oApplications.SaveChanges

Open in new window

0
 

Author Closing Comment

by:jasonabarnett
ID: 34105149
Not a complete answer but put me on the road to the ultimate solution.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now