code: public static void setTimeout(TransactionImpl tran, int timeoutType, int seconds)
      {
          if (tc.isEntryEnabled())
              Tr.entry(tc, "setTimeout",
                       new Object[] { tran, timeoutType, seconds });
  
          switch (timeoutType)
          {
          // If the new type is active or in_doubt, then create a new TimeoutInfo
          // if
          // necessary, and set up the type and interval.
              case TimeoutManager.ACTIVE_TIMEOUT:
              case TimeoutManager.IN_DOUBT_TIMEOUT:
              case TimeoutManager.REPEAT_TIMEOUT:
                  TimeoutInfo info = tran.setTimeoutInfo(new TimeoutInfo(tran, seconds, timeoutType));
  
                  if (tc.isDebugEnabled() && info != null
                      && timeoutType != TimeoutManager.REPEAT_TIMEOUT)
                      Tr.debug(tc, "Found existing timeout for transaction: " + info);
                  // not expecting this, should we cancel it?
  
                  break;
  
              // For any other type, remove the timeout if there is one.
              default:
                  info = tran.getTimeoutInfo();
                  if (null != info)
                  {
                      tran.setTimeoutInfo(null);
                      info.cancelAlarm();
                  }
                  else
                  {
                      if (tc.isDebugEnabled())
                          Tr.debug(tc,
                                   "Failed to find existing timeout for transaction: "
                                                   + tran);
                  }
  
                  break;
          }
  
          if (tc.isEntryEnabled())
              Tr.exit(tc, "setTimeout");
      }
docs: Sets the timeout for the transaction to the specified type and time in
  seconds.
  <p>
  If the type is none, the timeout for the transaction is
  cancelled, otherwise the current timeout for the transaction is modified
  to be of the new type and duration.
  
  @param localTID The local identifier for the transaction.
  @param timeoutType The type of timeout to establish.
  @param seconds The length of the timeout.
  
  @return Indicates success of the operation.