Solved

COM+ Component Transaction Isolation Level

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

816 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

8 Experts available now in Live!

Get 1:1 Help Now