Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 85443 invoked from network); 27 Feb 2009 16:39:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Feb 2009 16:39:40 -0000 Received: (qmail 91921 invoked by uid 500); 27 Feb 2009 16:39:35 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 91896 invoked by uid 500); 27 Feb 2009 16:39:35 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 91871 invoked by uid 99); 27 Feb 2009 16:39:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Feb 2009 08:39:35 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Feb 2009 16:39:33 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D9203234C48D for ; Fri, 27 Feb 2009 08:39:12 -0800 (PST) Message-ID: <331830248.1235752752887.JavaMail.jira@brutus> Date: Fri, 27 Feb 2009 08:39:12 -0800 (PST) From: "David Franke (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Created: (JCR-2001) requestObjectCache not cleared in ObjectContentManager.getObjectIterator() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org requestObjectCache not cleared in ObjectContentManager.getObjectIterator() -------------------------------------------------------------------------- Key: JCR-2001 URL: https://issues.apache.org/jira/browse/JCR-2001 Project: Jackrabbit Content Repository Issue Type: Bug Components: jackrabbit-ocm Affects Versions: 1.5.2 Reporter: David Franke Fix For: 1.5.2 I found this bug using an old snapshot version (1.5-ASF666297), but I had a look at the sources in the trunk and the implementation has not changed, so I assume it still exists. This bug only applies to the two methods Iterator getObjectIterator(...). Collection getObjects(...) works. The method public Object getObject(Session session, String path) puts objects in the RequestObjectCache. If an object is already cached it is retrieved from the cache. if (requestObjectCache.isCached(path)) { return requestObjectCache.getObject(path); } In ObjectContentManager.getObjects() this cache is cleared after retrieving the object. In ObjectContentManager.getObjectIterator() this is never cleared. This makes problems if I make several searches with the same ObjectContentManager while the data in the repository changes. Example: UserSearch searches for all user with a given name. An XPath is created like this: //(*, xy:user)[@name='givenName'] It always keeps the same instance of ObjectContenManager to call the search until the session expires: userIterator = ocm.getObjectIterator(query,Query.XPATH); ... In the meantime a user may change his name. When I now search for this new name, the user is found, but the old user object will be returned (with old name). There is no way to clear the cache manually. ocm.refresh(false) does not help in this case. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.