Return-Path: Delivered-To: apmail-incubator-jspwiki-dev-archive@minotaur.apache.org Received: (qmail 98367 invoked from network); 6 May 2010 01:37:12 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 May 2010 01:37:12 -0000 Received: (qmail 62084 invoked by uid 500); 6 May 2010 01:37:12 -0000 Delivered-To: apmail-incubator-jspwiki-dev-archive@incubator.apache.org Received: (qmail 62071 invoked by uid 500); 6 May 2010 01:37:12 -0000 Mailing-List: contact jspwiki-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jspwiki-dev@incubator.apache.org Delivered-To: mailing list jspwiki-dev@incubator.apache.org Received: (qmail 62063 invoked by uid 99); 6 May 2010 01:37:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 May 2010 01:37:12 +0000 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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 May 2010 01:37:09 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o461alf7006148 for ; Thu, 6 May 2010 01:36:48 GMT Message-ID: <5167431.181273109807550.JavaMail.jira@thor> Date: Wed, 5 May 2010 21:36:47 -0400 (EDT) From: "Magnus Lindberg (JIRA)" To: jspwiki-dev@incubator.apache.org Subject: [jira] Commented: (JSPWIKI-649) CachingProvider.deleteVersion leaves a stale m_historyCache In-Reply-To: <10555525.11001273032782009.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JSPWIKI-649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12864614#action_12864614 ] Magnus Lindberg commented on JSPWIKI-649: ----------------------------------------- Hi Harry, thanks for the information on code formatting. The scenario is, briefly, that I delete old versions of certain pages, and if the version history is not up-to-date, I attempt to delete versions that don't exist, and then a NoSuchVersionException is thrown. A more detailed explanation follows: I have written a discussion forum plugin. Each discussion thread (i.e. each topic) is stored in a page with a certain suffix. Each such discussion-thread-storage-page itself contains all version history (i.e. all comments for that thread/topic). Hence only the very last version of such a page is needed. So, when a new comment is added, the plugin creates a new version of the discussion-storage-page,\\ and iterates all old page versions,\\ and deletes them. Since the version history information provided by {{WikiPageProvider.getVersionHistory}} is sometimes out-of-date\\ (because of the bug in {{CachingProvider}}),\\ the plugin sometimes attempts to delete a version of a page that does not exist. This results in a {{NoSuchVersionException}} from {{WikiPageProvider.deleteVersion}}. (I suppose the cache is refreshed after some seconds, so this is perhaps only an issue if two comments are added to a discussion within a short period of time.) *** (It seems JSPWiki 3.0 uses the {{CachingProvider}} no more, so probably only the 2.8 branch (and other 2.X perhaps) are affected.) *** ( What I really wish to do is to 1) disable versioning for the relevant pages, and 2) also disallow anyone from reading/editing those magic discussion-storage-pages. -- but these are two separate issues, I suppose; I'd better ask on the user's mailing list in case other people are also interested. ) Regards, Magnus > CachingProvider.deleteVersion leaves a stale m_historyCache > ----------------------------------------------------------- > > Key: JSPWIKI-649 > URL: https://issues.apache.org/jira/browse/JSPWIKI-649 > Project: JSPWiki > Issue Type: Bug > Components: Core & storage > Affects Versions: 2.8.3, 2.8.4 > Environment: Ubuntu, Sun Java 1.6 > Reporter: Magnus Lindberg > Priority: Minor > Attachments: jira-jspwiki-cachingprovider-patch.txt > > > Hi JSPWiki developers, > The function > public void deleteVersion( String pageName, int version ) > in class CachingProvider does not always update the page history cache appropriately. > As a result, NoSuchVersionException:s can be thrown, if it's later assumed that a page exists, > because it's present in the (cached) history list. > Below patch should fix the bug. (Works for me.) > Regards, Magnus >
> Index: src/com/ecyrd/jspwiki/providers/CachingProvider.java
> ===================================================================
> --- src/com/ecyrd/jspwiki/providers/CachingProvider.java	(revision 938415)
> +++ src/com/ecyrd/jspwiki/providers/CachingProvider.java	(working copy)
> @@ -815,10 +815,10 @@
>              {
>                  m_cache.removeEntry( pageName );
>                  m_textCache.removeEntry( pageName );
> -                m_historyCache.removeEntry( pageName );
>              }
>  
>              m_provider.deleteVersion( pageName, version );
> +            m_historyCache.removeEntry( pageName );
>          }
>      }
> 
-- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.