Solved

COM+ Component Transaction Isolation Level

Posted on 2010-11-10
4
870 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 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

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!

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…
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

724 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