public function begin(int $keepAliveTimeout = 90) {
        $this->txKeepAlive = $keepAliveTimeout;
        $this->txTimestamp = time();

        $resp = $this->client->post($this->apiUrl . '/fcr:tx');
        $loc  = $resp->getHeader('Location');
        if (count($loc) == 0) {
            throw new RuntimeException('wrong response from fedora');
        }
        $this->txUrl = $loc[0];

        if (function_exists('pcntl_fork')) {
            $this->txProcPid = pcntl_fork();
            if ($this->txProcPid === 0) {
                $this->keepTransactionAlive();
            }
        } else if (defined('STDIN')) {
            if (!function_exists('curl_init')) {
                throw new RuntimeException('Please enable the curl extension in your php.ini');
            }
            $this->txProc = new KeepTransactionAlive($this->txUrl, RC::get('fedoraUser'), RC::get('fedoraPswd'), $this->txKeepAlive);
        }
    }