Set the idle transaction processing parameters on the server.


Namespace: NetricsServerInterface
Assembly: NetricsServerInterface (in NetricsServerInterface.dll)

Syntax

Visual Basic (Declaration)
Public Sub tranSetIdleOpts( _ 
   ByVal idle_time As Integer,  _ 
   ByVal action As String _ 
)
C#
public void tranSetIdleOpts(
   int idle_time,
   string action
)
C++
public:
 void tranSetIdleOpts(
   int idle_time,
   String action
) sealed 
J#
public void tranSetIdleOpts(
   int idle_time,
   string action
)
JScript
public  function tranSetIdleOpts(
   idle_time : int,
   action : String
)

Parameters

idle_time
This defines how many seconds a transaction must sit idle before the clean up action is performed. If this value is zero the max idle time is considered to be infinite (i.e. no clean up is performed). If this value is less than zero the max idle time parameter is left unchanged.
action
This defines the action to be performed on all transactions that exceed the maximum idle time. It is a one character flag with values: a abort the transaction, c commit the transaction, e abort the transaction if it has errors, otherwise commit the transaction, n do nothing. If this argument is null, an empty string or a single blank character the parameter is left unchanged.

Exceptions

Exception TypeCondition
NetricsExceptionIf the server indicates that an error has occured.

Remarks

This method is used to set the parameters that control how idle transactions are treated on the server. Transactions that sit idle for long periods of time can be cleaned up automatically by the server. These parameters define how that clean up processing is performed.

A transaction is idle when no commands are being run under that transaction. The idle time is the time from the completion of the last command associated with the transaction to the present time.

The purpose of idle transaction clean up is to take care of transactions that were abandoned, e.g. an application crashed in the middle of the transaction and thus will never close it. These parameters can be set from command line arguments when the server is started, so generally it is not necessary to do so from the API.

The server doesn't guarantee that a transaction will be cleaned up as soon as it exceeds the idle time. Checks are made on a periodic basis, so transactions may be idle for some seconds past the maximum before they are detected.

See Also