Configure the runtime transaction service using scripting
Use the wsadmin tool to configure transaction properties for servers. The transaction service is a server runtime component that coordinates updates to multiple resource managers to ensure atomic updates of data. Transactions are started and ended by applications or the container in which the applications are deployed.
There are two ways to perform this task. Use the steps in this task to use the AdminControl object to modify the transaction service configuration. Alternatively, we can use the configureTransactionService Jython script in the AdminServerManagement script library to configure the transaction service configuration attributes. Use the configureRuntimeTransactionService to update the transaction service Bean attributes. The wsadmin tool automatically loads the scripts when the tool starts.
Use the following syntax to configure transaction service settings using the configureTransactionService script:
AdminServerManagement.configureTransactionService(nodeName, serverName, totalTranLifetimeTimeout, clientInactivityTimeout, maximumTransactionTimeout, heuristicRetryLimit, heuristicRetryWait, propogatedOrBMTTranLifetimeTimeout, asyncResponseTimeout, otherAttributeList)Use the following syntax to configure runtime transaction service settings using the configureRuntimeTransactionService script:
AdminServerManagement.configureRuntimeTransactionService(nodeName, serverName, totalTranLifetimeTimeout, clientInactivityTimeout)For additional information and argument definitions, see the documentation for the AdminServerMananagment script library.
Tasks
- Identify the transaction service MBean for the application server.
Use the completeObjectName command for the AdminControl object to return the transaction service MBean for the server1 server, and to set it to the ts variable:
- 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 ts
Element Description set A Jacl command ts A variable name $ A Jacl operator for substituting a variable name with its value AdminControl An object that enables the manipulation of MBeans running in a server process completeObjectName An AdminControl command cell=mycell,node=mynode, process=server1,type=TransactionServiceA 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 used 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, and process. Example output:
WebSphere:cell=mycell,name=TransactionService,mbeanIdentifier=TransactionService, type=TransactionService,node=mynode,process=server1- Modify the runtime transaction service configuration attributes.
- Use Jacl:
$AdminControl setAttributes $ts {{clientInactivityTimeout 30} {totalTranLifetimeTimeout 180}}- Use Jython:
AdminControl.setAttributes(ts, [['clientInactivityTimeout', 30], ['totalTranLifetimeTimeout', 180]])
The following table shows the elements in the previous commands.
Element Description $ Jacl operator for substituting a variable name with its value AdminControl An object that enables the manipulation of MBeans running in a server process setAttributes An AdminControl command ts Evaluates to the ID of the transaction service of interest clientInactivityTimeout An attribute 30 The value of the clientInactivityTimeout attribute specified in seconds. A value of 0 means that there is no timeout limit. totalTranLifetimeTimeout An attribute 180 The value of the totalTranLifetimeTimeout attribute specified in seconds. A value of 0 means that there is no timeout limit.
Subtopics
- Configure the WS-Transaction specification level by
We can configure the default WS-Transaction specification level to use for outbound requests that include a Web Services Atomic Transaction (WS-AT) or Web Services Business Activity (WS-BA) coordination context.
Configure transaction properties for an application server Automating server administration wsadmin AdminControl Node administration scripts Server settings configuration scripts Transaction service settings Commands for the AdminControl object