7.6.1 Set Transaction Timeout

Specify the time period for which a request sent from the XA participant services remains active. If a transaction is not committed or rolled back within the specified time period, the transaction is rolled back.

Specify this value only for the transaction initiator application. The transaction initiator service propagates the timeout value, that you have specified, to the participant services. If you specify this value for a participant application, it is ignored.

Note:

The value that you provide specifies the timeout for the overall transaction. While deciding the transaction timeout, you must consider the resource manager latency too.

To set transaction timeout for requests sent from participants services:

  1. In the transaction coordinator configuration parameters, specify the maximum amount of time, in milliseconds, for which a transaction remains active. Specify a value for the txMaxTimeout parameter in the values.yaml file of the MicroTx coordinator. The default value is 60000 ms.
    The values.yaml file of the MicroTx is located in the installation_directory/otmm-RELEASE/otmm/helmcharts folder.
  2. In the transaction initiator service, specify the amount of time, in milliseconds, for which a transaction remains active. If a transaction is not committed or rolled back within the specified time period, the transaction is rolled back. The default value and minimum value is 60000. You can specify this value in the application code or as a property value. The value specified in the application code overrides the property value.

    Specify a value for one of the following MicroTx library properties, depending on the type of your initiator service.

    • For Node.js and JAX-RS applications based on Helidon, provide a value for the oracle.tmm.TransactionTimeout property.
    • For Spring Boot applications, provide a value for the spring.microtx.xa-transaction-timeout property.
The value of transaction timeout specified for the initiator service can override the value of txMaxTimeout specified for the transaction coordinator, but it cannot exceed the value of txMaxTimeout. For example, if the value of txMaxTimeout is 70000 and the value of transaction timeout specified for the initiator service is 80000, then the maximum timeout is set to 70000 milliseconds. If the value of txMaxTimeout is 90000 and the value of transaction timeout specified for the initiator service is 80000, then the maximum timeout is set to 80000 milliseconds.