0
votes

I need to make a few changes to the "Transaction service" section of a bunch of WebSphere application servers. I was hoping to script things using wsadmin.

One of the properties that I want to change is the "Transaction log directory". I tried to following tutorial:

The problem is that my recoveryLog object is always empty (with a Jython value of None) Is there another way to change this value?

Related to this question, are there properties that I can edit using the WAS web console that I can't edit using wsadmin? I would like to change a few more "deeply nested" properties and I want to make sure that I'm not wasting my time.

2

2 Answers

1
votes

I was able to change the log directory with the following commands:

serverEntryId = AdminConfig.getid("/ServerEntry:server1")
recoveryLog = AdminConfig.showAttribute(serverEntryId, "recoveryLog")
AdminConfig.modify(recoveryLog, '[[transactionLogDirectory c:/mylog]]')
AdminConfig.save()

Regarding your second question - everything what you can do via web console is doable via wsadmin scripting.

0
votes

Gas' answer is correct, assuming that you create the trans log first using the directions in his comments. I solved this problem a little differently though using the execellent WDR library. Here's how I did it:

mySeverEntry = listConfigObjects("ServerEntry", "*TomsServer*")[0]
mySeverEntry.create("RecoveryLog", 
        transactionLogDirectory="/some/dir1"), 
        compensationLogDirectory="/some/dir2"), 
        compensationLogFileSize="5") 
save()
sync()

I highly recommend the WDR library if you're looking for a more concise, pythonic way of scripting wsadmin changes.