Configure transaction properties for a server using scripting
Use scripting to configure transaction properties for servers. Before starting this task, the wsadmin tool must be running. See the Start the wsadmin scripting client article for more information.
Overview
Perform the following steps to configure the runtime transaction properties for an appserver.
Procedure
- Identify the transaction service MBean for the appserver. The following command returns the transaction service MBean for server1.
- Use Jacl:
set ts [$AdminControl completeObjectName cell=mycell,node=mynode,process=server1,type=TransactionService,*]
- Use Jython:
ts = AdminControl.completeObjectName('cell=mycell,node=mynode,process=server1,type=TransactionService,*') print tswhere:
set Jacl command ts variable name $ Jacl operator for substituting a variable name with its value AdminControl object that enables the manipulation of MBeans running in a WebSphere server process completeObjectName AdminControl command cell=mycell,node=mynode,process=server1,type=TransactionService fragment of the object name whose complete name is returned by this command. It is used to find the matching object name which is, in this case, the transaction object MBean for the node mynode, where mynode is the name of the node that you use to synchronize configuration changes. For example: type=TransactionService, process=server1. It can be any valid combination of domain and key properties. For example, type, name, cell, node, process, etc. Example output:
WebSphere:cell=mycell,name=TransactionService,mbeanIdentifier=TransactionService, type=TransactionService,node=mynode,process=server1
- Modify the attributes.
Use Jacl:
$AdminControl setAttributes $ts {{clientInactivityTimeout 30} {totalTranLifetimeTimeout 180}}Use Jython:
AdminControl.setAttributes(ts, [['clientInactivityTimeout', 30], ['totalTranLifetimeTimeout', 180]])where:
$ Jacl operator for substituting a variable name with its value AdminControl object that enables the manipulation of MBeans running in a WebSphere server process setAttributes AdminControl command ts evaluates to the ID of the transaction service specified in step number 1 clientInactivityTimeout attribute 30 value of the clientInactivityTimeout attribute specified in seconds. A value of 0 means that there is no timeout limit. totalTranLifetimeTimeout attribute 180 value of the totalTranLifetimeTimeout attribute specified in seconds. A value of 0 means that there is no timeout limit.
Use the AdminControl object for scripted administration
Related Reference
Commands for the AdminControl object