code: public TransactionOptions setTimeout(long timeout, TimeUnit timeUnit) {
          if (timeout < 0) {
              throw new IllegalArgumentException("Timeout can not be negative!");
          }
          if (timeUnit == null) {
              throw new IllegalArgumentException("timeunit can't be null");
          }
          if (timeout == 0) {
              setDefaultTimeout();
          } else {
              this.timeoutMillis = timeUnit.toMillis(timeout);
          }
          return this;
      }
docs: Sets the timeout.
  <p/>
  The timeout determines the maximum lifespan of a transaction. So if a transaction is configured with a
  timeout of 2 minutes, then it will automatically rollback if it hasn't committed yet.
  
  @param timeout  the timeout.
  @param timeUnit the TimeUnit of the timeout.
  @return the updated TransactionOptions
  @throws IllegalArgumentException if timeout smaller or equal than 0, or timeUnit is null.
  @see #getTimeoutMillis()