Return-Path: X-Original-To: apmail-wicket-users-archive@minotaur.apache.org Delivered-To: apmail-wicket-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8111E105B3 for ; Sun, 3 May 2015 16:02:04 +0000 (UTC) Received: (qmail 73180 invoked by uid 500); 3 May 2015 16:01:58 -0000 Delivered-To: apmail-wicket-users-archive@wicket.apache.org Received: (qmail 73128 invoked by uid 500); 3 May 2015 16:01:58 -0000 Mailing-List: contact users-help@wicket.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@wicket.apache.org Delivered-To: mailing list users@wicket.apache.org Received: (qmail 73114 invoked by uid 99); 3 May 2015 16:01:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 May 2015 16:01:58 +0000 X-ASF-Spam-Status: No, hits=3.2 required=5.0 tests=HTML_MESSAGE,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of mscoon@gmail.com does not designate 54.191.145.13 as permitted sender) Received: from [54.191.145.13] (HELO mx1-us-west.apache.org) (54.191.145.13) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 May 2015 16:01:51 +0000 Received: from mail-ie0-f171.google.com (mail-ie0-f171.google.com [209.85.223.171]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 9ED9824945 for ; Sun, 3 May 2015 16:01:31 +0000 (UTC) Received: by iejt8 with SMTP id t8so116223390iej.2 for ; Sun, 03 May 2015 09:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=76BCvtXLEj1IMWzhQUb3i4npB2Qe/sBiwEWjk7AunGo=; b=UXcaytb9ra2p5sYOl+oUJvfI2fQLBEf0FJQMsaombgzklDo4wMRs265YaWLWLkJ5Q0 e1f4dV7Xtiy01ipScxWLOYrl0zruyg6LwURKQKtS9BL+aZi0771861SSO37Te64NNbhv dG8/Vi28eEVCNGd2/yrXT6SOptMmUlp8GdQMEoU8Ac+t31AVnJ66FJihDBd6BOOdJBRX LzJdrr2Yz/WNP50ReG6hByPTP6076wip4Ohggpf412BTnLMy80mDeNnNgZyol8HDy5QB g2RLJJv6iN2I9TV4bjACD+aGY4TtbmC7W+8qN8eXuKYLx3aJbcM8im2GEV2/l0pbrH2c 9JzA== MIME-Version: 1.0 X-Received: by 10.50.62.148 with SMTP id y20mr8458510igr.17.1430668884884; Sun, 03 May 2015 09:01:24 -0700 (PDT) Received: by 10.107.162.3 with HTTP; Sun, 3 May 2015 09:01:24 -0700 (PDT) In-Reply-To: References: Date: Sun, 3 May 2015 19:01:24 +0300 Message-ID: Subject: Re: Checking obscure serialization bugs during development From: mscoon To: users@wicket.apache.org Content-Type: multipart/alternative; boundary=047d7bdcab34acc22d05152f8e16 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bdcab34acc22d05152f8e16 Content-Type: text/plain; charset=UTF-8 Hi, it turns out that removing the session attribute as in Session().get(). removeAttribute("wicket:persistentPageManagerData - " + Application.get().getName()) does not work because the result is that no pages are ever retrieved. Instead you need to get the attribute, which is a PageStoreManager$SessionEntry object, and nullify it's private sessionCache attribute. So this results is some ugly code accessing wicket internals but it seems to work, and since it's only for testing, it's okay. Thanks for the help, Martin. On Wed, Jan 14, 2015 at 10:32 AM, Martin Grigorov wrote: > Hi, > > There is no setting to tell Wicket to not store the page(s) used in the > last request cycle in the memory (http session). > But you can workaround this by null-ifying the session attribute in > IRequestCycleListener#onBeginRequest() for example. > You need something like: > Session().get().removeAttribute("wicket:persistentPageManagerData - " + > Application.get().getName()) > This way Wicket will always load the page from the second/third level > stores (i.e. its serialized version). > > See http://wicket.apache.org/guide/guide/internals.html#pagestoring for > some more details. > > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > On Tue, Jan 13, 2015 at 6:30 PM, mscoon wrote: > > > Hi all, > > > > There are some application (not wicket!) bugs that occur only when wicket > > serializes a page, while the same code works if the page is kept in > memory > > during subsequent requests. > > > > For instance a == comparison may fail if either side of the expression is > > serialized/deserialized. > > > > These bugs often go unnoticed during development since usually the active > > page is kept in memory. > > > > So I was wondering if there is a way to force wicket during development > to > > always serialize pages and never keep any pages in memory in order to > make > > such bugs more apparent to the developer. > > > > Thanks in advance > > Marios > > > --047d7bdcab34acc22d05152f8e16--