?
Solved

COM+ Component Transaction Isolation Level

Posted on 2010-11-10
4
Medium Priority
?
875 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 8

Accepted Solution

by:
GundogTrainer earned 1500 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

762 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