Hitachi

uCosminexus Application Server System Design Guide


8.6.4 Setting the transaction timeout

This section explains the transaction timeout settings. Set the timeout for transactions with EIS such as the database system. This section describes the transaction timeout when DB Connector is used for accessing the database.

When setting the transaction timeout, amongst all the timeout values of the entire system, you need to consider the transaction of the database with the EJB container (point 10 in the figure). These numbers correspond to Figure 8-9 or Figure 8-10.

Figure 8‒13: Timeout points to be considered in the case of transaction with EIS

[Figure]

The Application Server will execute the following processes when there is a transaction timeout:

Tip

The process for defining the transaction timeout differs for CMT and UserTransaction.

  • For CMT

    You can define the transaction timeout for CMT in usrconf.properties or you can set the timeout as an attribute of the Enterprise Bean, interface or method. Use the server management commands for setting Enterprise Bean, interface or method attributes.

    The definition of the usrconf.properties affects the entire process. The timeout value specified in the Enterprise Bean, interface or method attributes affect only the transactions used by the relevant Enterprise Bean, interface or method. These specifications override the definitions in usrconf.properties.

    Hitachi, therefore, recommends that you define the standard values to be set in the entire process, in the usrconf.properties and set the detailed values, as per the invoked business, as the attributes of the Enterprise Bean, interface or method.

  • For UserTransaction

    You can specify a transaction timeout for UserTransaction in usrconf.properties or in JTA API (the javax.transaction.UserTransaction#setTransactionTimeout method). The definition of the usrconf.properties affects the entire process. The timeout value specified in API only affects the transactions that issued the API. The API specifications override the definitions in usrconf.properties.

    Hitachi, therefore, recommends that you define the standard values to be set in the entire process, in the usrconf.properties and use the appropriate API to set the detailed values as per the invoked business.

Tip

Set the values related to transaction timeout and connection establishment in such a way that the following relationship is satisfied.

transaction-timeout > timeout-for-connection-establishment-when-all-connections-are-in-use + timeout-when-failure-is-detected + maximum-wait-time-for-connection-establishment × execution-count-of-connection-establishment + retry-interval × retry-count

This relationship, if shown with parameters, is as follows:

ejbserver.jta.TransactionManager.defaultTimeOut > RequestQueueTimeout + ejbserver.connectionpool.validation.timeout + loginTimeout × (RetryCount+1) + RetryInterval × RetryCount

When setting the transaction timeout, you need to account for the execution time of the transaction in addition to the time taken for connection establishment.

If a transaction timeout occurs, the exception is not notified to the user application. The message KDJE31002-W, however, is output to the log file and the J2EE server. An exception is notified when you attempt to use the JTA interface or the JDBC interface by using the relevant transaction from the user application.