WAS v8.5 > Script the application serving environment (wsadmin) > Configure servers with scripting

Configure the runtime transaction service using scripting

Use wsadmin 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 your transaction service configuration. Alternatively, we can use the configureTransactionService Jython script in the AdminServerManagement script library to configure the transaction service configuration attributes. We can use the configureRuntimeTransactionService to update the transaction service MBean 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, propogateOrBMTTranLifetimeTimeout, 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.

  1. 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, as the following example demonstrates:

    • Jacl:
      set ts [$AdminControl completeObjectName cell=mycell,node=mynode,
      process=server1,type=TransactionService,*]
    • Using Jython:
      ts = AdminControl.completeObjectName('cell=mycell,node=mynode,
      process=server1,type=TransactionService,*')
      print ts

    Elements in the completeObjectName command. This tables describes the elements used to return the transaction service MBean for the server in the previous example commands.

    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=TransactionService
    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 we 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, and process.

    Example output:

    WebSphere:cell=mycell,name=TransactionService,mbeanIdentifier=TransactionService,
    type=TransactionService,node=mynode,process=server1

  2. Modify the runtime transaction service configuration attributes.

    • Jacl:
      $AdminControl setAttributes $ts {{clientInactivityTimeout 30} 
      {totalTranLifetimeTimeout 180}}
    • Using Jython:
      AdminControl.setAttributes(ts, [['clientInactivityTimeout', 30],
      ['totalTranLifetimeTimeout', 180]])

    The following table shows the elements in the previous commands.

    Elements in the setAttributes command. This tables describes the elements in the setAttributes command.

    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 there is no timeout limit.
    totalTranLifetimeTimeout An attribute
    180 The value of the totalTranLifetimeTimeout attribute specified in seconds. A value of 0 means there is no timeout limit.


Subtopics


Related


Configure transaction properties for an application server
Automating server administration using wsadmin.sh
Use the wsadmin scripting AdminControl object for scripted administration


Reference:

Server settings configuration scripts
Transaction service settings
Commands for the AdminControl object using wsadmin.sh


+

Search Tips   |   Advanced Search