public ClickHouseTransaction getOrStartTransaction(ClickHouseRequest<?> request, int timeout)
            throws ClickHouseException {
        if (timeout < 1) {
            timeout = request.getConfig().getTransactionTimeout();
        }
        ClickHouseTransaction tx = ClickHouseChecker.nonNull(request, "Request").getTransaction();
        if (tx != null && tx.getTimeout() == timeout) {
            return tx;
        }

        tx = createTransaction(request.getServer(), timeout);
        tx.begin();
        request.transaction(tx);
        return tx;
    }
Gets or starts a new transaction. {@link #createSessionId()} will be called
to when a new transaction is created.

@param request non-null request
@param timeout transaction timeout in seconds, zero or negative number
               means {@code request.getConfig().getTransactionTimeout()}
@return non-null transaction in {@link ClickHouseTransaction#ACTIVE} state
@throws ClickHouseException when failed to get or start transaction
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseRequestManager.java