Configure transaction properties for a server using scripting
Procedure
- Start wsadmin
- Identify the transaction service MBean for the application server. The following command returns the transaction service MBean for server1.
set ts [$AdminControl completeObjectName cell=mycell,node=mynode,process=server1,type=TransactionService,*] ts = AdminControl.completeObjectName('cell=mycell,node=mynode,process=server1,type=TransactionService,*') print ts
where:
set is a Jacl command ts is a variable name $ is a Jacl operator for substituting a variable name with its value AdminControl is an object that enables the manipulation of MBeans running in a WebSphere server process completeObjectName is an AdminControl command cell=mycell,node=mynode,process=server1,type=TransactionService is a 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.
Jacl:
$AdminControl setAttributes $ts {{clientInactivityTimeout 30} {totalTranLifetimeTimeout 180}} AdminControl.setAttributes(ts, [['clientInactivityTimeout', 30], ['totalTranLifetimeTimeout', 180]])
where:
$ is a Jacl operator for substituting a variable name with its value AdminControl is an object that enables the manipulation of MBeans running in a WebSphere server process setAttributes is an AdminControl command ts evaluates to the ID of the transaction service specified in step number 1 clientInactivityTimeout is an attribute 30 is the value of the clientInactivityTimeout attribute specified in seconds. A value of 0 means that there is no timeout limit. totalTranLifetimeTimeout is an attribute 180 is the value of the totalTranLifetimeTimeout attribute specified in milliseconds. A value of 0 means that there is no timeout limit.
See Also
AdminControl object for scripted administration
See Also
Commands for the AdminControl object