Return-Path: X-Original-To: apmail-incubator-jena-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-jena-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9DDCB9DCD for ; Mon, 14 Nov 2011 22:11:27 +0000 (UTC) Received: (qmail 9460 invoked by uid 500); 14 Nov 2011 22:11:27 -0000 Delivered-To: apmail-incubator-jena-dev-archive@incubator.apache.org Received: (qmail 9429 invoked by uid 500); 14 Nov 2011 22:11:27 -0000 Mailing-List: contact jena-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jena-dev@incubator.apache.org Delivered-To: mailing list jena-dev@incubator.apache.org Received: (qmail 9421 invoked by uid 99); 14 Nov 2011 22:11:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Nov 2011 22:11:27 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of andy.seaborne.apache@gmail.com designates 74.125.82.175 as permitted sender) Received: from [74.125.82.175] (HELO mail-wy0-f175.google.com) (74.125.82.175) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Nov 2011 22:11:19 +0000 Received: by wyg8 with SMTP id 8so2027610wyg.6 for ; Mon, 14 Nov 2011 14:10:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=W6Cl9zOQkl7ZnM5mJ3ilg5UPSBGAGUFKbGbFgQGamDg=; b=E6w3uD8/6QV/gvk7PHYDgGsnwDJnkQzsJWLuhp1VbzCBtn3ZP5/elRGr8m4uCUcynf 8fJDf5BXuGEsMgiLZyhF++y0GfvymNIW68RnH8atB7DIsznuTdlbTINN2ezQpt7SVFQC pkmAJl6kCiAs6XRoHhuFzGZTBgbysrBLQqOjw= Received: by 10.227.199.132 with SMTP id es4mr16077075wbb.5.1321308658324; Mon, 14 Nov 2011 14:10:58 -0800 (PST) Received: from [192.168.1.10] (cpc4-aztw23-2-0-cust915.aztw.cable.virginmedia.com. [94.171.231.148]) by mx.google.com with ESMTPS id fw16sm26446083wbb.13.2011.11.14.14.10.56 (version=SSLv3 cipher=OTHER); Mon, 14 Nov 2011 14:10:57 -0800 (PST) Sender: Andy Seaborne Message-ID: <4EC191EF.90303@apache.org> Date: Mon, 14 Nov 2011 22:10:55 +0000 From: Andy Seaborne User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Simon Helsen CC: jena-dev@incubator.apache.org, Andy Seaborne Subject: Re: IRIResolver cache not thread safe? References: <4EAF1C43.7030100@apache.org> <4EB24D59.8060903@apache.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 14/11/11 20:20, Simon Helsen wrote: > Andy, > > thanks, I was digging through the code paths both in the latest as well > as the version we currently still have deployed (arq 2.8.5) and it seems > that the only difference is that in 2.8.5, the readImpl of JenaReadRIOT > calls the resolve here: > > *private**void*readImpl(Model model, Tokenizer tokenizer, String base) > { > // The reader has been checked, if possible, by now or > // constructed correctly by code here. > *if*( base != *null*) > base = IRIResolver./resolveGlobalToString/(base) ; > *try*{ > model.notifyEvent( GraphEvents./startRead/); > readWorker(model, tokenizer, base) ; > } > ... > whereas in the latest, there is no resolution of the base at all at that > stage: > > *private**void*readImpl(Model model, Tokenizer tokenizer, String base) > { > *try*{ > model.notifyEvent( GraphEvents./startRead/); > readWorker(model, tokenizer, base) ; > } > ... > > Now, deeper down, both create an IRIResolverNormal object, so I am > guessing it is safe if I patch our current version to remove the call to > resolveGlobalToString. Any comments? (and before you ask, this is > because we are currently not yet upgrading the jena stack, but I need to > fix this since it leads to concurrency errors during our indexing process) > > thanks > > Simon Better would be to patch IRIresolver and add "synchronized" to every static function that uses "globalResolver". Deleting the code from readImpl means that you've change the behaviour of reading when the base is provided. Maybe your code always sets an absolute base ... but safer to fix IRIResolver IMO. I don't think globalResolver isn't let out of IRIResolver in v2.8.5 Andy