From commits-return-76796-archive-asf-public=cust-asf.ponee.io@wicket.apache.org Mon Jul 26 20:04:09 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 892AE180181 for ; Mon, 26 Jul 2021 22:04:09 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id 14F313FCFE for ; Mon, 26 Jul 2021 20:04:02 +0000 (UTC) Received: (qmail 16448 invoked by uid 500); 26 Jul 2021 20:04:01 -0000 Mailing-List: contact commits-help@wicket.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@wicket.apache.org Delivered-To: mailing list commits@wicket.apache.org Received: (qmail 16428 invoked by uid 99); 26 Jul 2021 20:04:01 -0000 Received: from mailrelay1-he-de.apache.org (HELO mailrelay1-he-de.apache.org) (116.203.21.61) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jul 2021 20:04:01 +0000 Received: from jira2-he-de.apache.org (unknown [IPv6:2a01:4f8:242:1f49::2]) by mailrelay1-he-de.apache.org (ASF Mail Server at mailrelay1-he-de.apache.org) with ESMTPS id B45BA3F3A0 for ; Mon, 26 Jul 2021 20:04:00 +0000 (UTC) Received: from jira2-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira2-he-de.apache.org (ASF Mail Server at jira2-he-de.apache.org) with ESMTP id 69818C807D6 for ; Mon, 26 Jul 2021 20:04:00 +0000 (UTC) Date: Mon, 26 Jul 2021 20:04:00 +0000 (UTC) From: "ASF subversion and git services (Jira)" To: commits@wicket.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WICKET-6908) Possible bug / edge case where page is not detached MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WICKET-6908?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D173= 87603#comment-17387603 ]=20 ASF subversion and git services commented on WICKET-6908: --------------------------------------------------------- Commit 05ab77655fb00d27ade1402b72db1dc6968b3dbe in wicket's branch refs/hea= ds/WICKET-6908-detach-failure from Sven Meier [ https://gitbox.apache.org/repos/asf?p=3Dwicket.git;h=3D05ab776 ] WICKET-6908 detach all handlers even if one throws a RuntimeException > Possible bug / edge case where page is not detached > --------------------------------------------------- > > Key: WICKET-6908 > URL: https://issues.apache.org/jira/browse/WICKET-6908 > Project: Wicket > Issue Type: Bug > Components: wicket-core > Affects Versions: 9.3.0, 9.4.0 > Reporter: Sebastian Gooren > Assignee: Sven Meier > Priority: Minor > Attachments: quickstart.zip > > > Today I spent the better part of my day investigating a bug report regard= ing a hibernate LazyInitializationException. > Since we use detaching models everywhere and (in general) never see such = issues anymore, this one was interesting :-) > =C2=A0 > After much debugging I found out what is happening. > =C2=A0 > We have a page which has a database model + links for prev/next item (in = the database). > When the users double-clicks on one of the links, the first click is OK, = and the second click throws a StalePageException during request cycle proce= ssing. > =C2=A0 > So far, normal. > =C2=A0 > However, stepping through the wicket code, this is what happens: > =C2=A0 > 1) Resolve to ListenerRequestHandler, execute it, throws StalePageExcepti= on > 2) exception mapper handles this and we execute a RenderPageRequestHandle= r, which re-renders the page > 3) the request cycle detaches, which delegates in part to=C2=A0RequestHan= dlerExecutor.detach() > 4) The handlers to detach are both handlers from step 1 and 2; During the= detach of ListenerRequestHandler, it initializes ListenerLogData, which (i= n the PageLogData ctor) throws the StalePageException again! > 5) The second handler (RenderPageRequestHandler) is not detached, thus al= l models in the page are not detached > 6) The user clicks on a link and boom, the models are all still attached = and there we get the LazyInitializationException > =C2=A0 > I think that (a)=C2=A0RequestHandlerExecutor.detach() should ensure all h= andlers are detached, and (b) that failing to collect LogData should not st= op the detaching of a request handler. > =C2=A0 > What do you think? > =C2=A0 > I tried to make the simplest possible Quickstart to demonstrate this. > =C2=A0 > Weird stuff: on the homepage of the quick start, the page is properly det= ached when a stale link is clicked; > On another (test) page, the page is not properly detached. > =C2=A0 > Steps to reproduce: > =C2=A0 > Run Quickstart > Click on =E2=80=9CTest=E2=80=9D link on homepage > Observe that the following is logged: > =C2=A0 > Model still attached? false > Page detaching > =C2=A0 > Now click on "Click me (stale link)!=E2=80=9D > Now refresh the page (re-render) > =C2=A0 > Observe that the following is logged: > =C2=A0 > Model still attached? true > Page detaching > =C2=A0 > =E2=80=94> So the page was not detached > =C2=A0 > These steps don=E2=80=99t have the same result on the homepage. So my gue= ss is there is some relation to the fact that we are interacting with a sta= teful, non-mounted page. -- This message was sent by Atlassian Jira (v8.3.4#803005)