Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F353A200CBE for ; Fri, 7 Jul 2017 23:45:33 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F1E4716A202; Fri, 7 Jul 2017 21:45:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4084316A201 for ; Fri, 7 Jul 2017 23:45:33 +0200 (CEST) Received: (qmail 86909 invoked by uid 500); 7 Jul 2017 21:45:32 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 86894 invoked by uid 99); 7 Jul 2017 21:45:32 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jul 2017 21:45:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 97FBA182914 for ; Fri, 7 Jul 2017 21:45:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.692 X-Spam-Level: *** X-Spam-Status: No, score=3.692 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id VNHE4ciZF5vh for ; Fri, 7 Jul 2017 21:45:29 +0000 (UTC) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com [209.85.214.46]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 24F155F6D3 for ; Fri, 7 Jul 2017 21:45:29 +0000 (UTC) Received: by mail-it0-f46.google.com with SMTP id k192so3875207ith.1 for ; Fri, 07 Jul 2017 14:45:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=RyRbOPKd2xzHZrbrG49x2i6OFhOgnBDB53l68Ahpivg=; b=f7Jd6OXEEjjC0D3Sy28XlLtab1glSMG1nLUQZa1MUCMhoe50yeMBuL8c57+LczIXXe rnQCl/64dmg/TinD9Cj5MEpJqJdkZF+UsyZgrta4gGfGI6LDXYdxQM0SxXJcCXGXVpcE RRW+swTlUIH4fDWwPTKdYDxMZDnFFQMSyI6Y50ltP5m8QY65LBZOPN0rzVZ++QD8VYdk SYVcalnCB0TtOZg7eu7agVbyIFHHbRWBF+M2nP66dtSnTjchzJ5syXG8OpcHpczcu28o V9scOOHYtJ4gzIdAWivMWBffxBI2yA21FBZOP95mwFrOGHmHurH6qPmhMbQkITmbu6mf /53w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=RyRbOPKd2xzHZrbrG49x2i6OFhOgnBDB53l68Ahpivg=; b=BGPE2WmT6tCG+8MNyqQegAgBnDWIata+/apYEBsSxlSs/NfCPEdVSifpOllVwkYeFf TBfQFyODd68OXxHStw1PEVLdAGiB5DpdY+5n4CVJKcpMK2EwQXEYUcdH+IYLXAcXj9+H u5l0AP3gQy+e4SAbZVdapRy/q+OPYtBe1tn9rNn5xOzZQmy6Uqzy4KgJoK13CLODLCCX 3IvR6vNshNm3n59bfPsLPT4xhkqU3bJZz5iWlPxY0xfeCRNXNZ3ZfACleiQeK7QECevK hfLI4h69ESIySy86cTKOcstkYtZCR8a51PyjrW5ChOjkLwh2GVwLbJqRbIjDNdDyV0iR INMQ== X-Gm-Message-State: AIVw113NEXvy+AKOqa6AfIwdl01unxwAxPWHUGTlaRRZ6K2llMzS+voh Ry2mRnJXHHTFCqCE5+zMuKl492zIZk43 X-Received: by 10.36.51.82 with SMTP id k79mr1174801itk.32.1499463921994; Fri, 07 Jul 2017 14:45:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.125.73 with HTTP; Fri, 7 Jul 2017 14:44:51 -0700 (PDT) In-Reply-To: <1499435972506-19575.post@n4.nabble.com> References: <1498645555365-19184.post@n4.nabble.com> <1498686226432-19211.post@n4.nabble.com> <1499250326734-19480.post@n4.nabble.com> <1499435972506-19575.post@n4.nabble.com> From: Valentin Kulichenko Date: Fri, 7 Jul 2017 14:44:51 -0700 Message-ID: Subject: Re: It seems WebSession's removeAttribute does not support HttpSessionBindingListener To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary="001a113f5dfe6c90e00553c1267b" archived-at: Fri, 07 Jul 2017 21:45:34 -0000 --001a113f5dfe6c90e00553c1267b Content-Type: text/plain; charset="UTF-8" This will not work. WebSessionV2 does not reinvent the wheel, it provides additional functionality. In particular, allows to use the same session in a clustered environment. Genuine session is local, so if you just rely on it, all session data will be lost when server that holds this session fails. Your listeners will not be invoked as well, BTW. That's exactly what we're trying to avoid by introducing this feature. However, I agree that there is an issue with expiration. It's currently handled based on ExpiryPolicy, i.e., if maxInactiveInterval is set, session will be removed from the cache. But looks like we do not invalidate the genuine session, which is wrong. I think we should add a CacheEntryListener that will listen to expirations and handle all required post actions - invalidation of genuine session and invoking the listeners. -Val On Fri, Jul 7, 2017 at 6:59 AM, yucigou wrote: > Hi Val, > > The mechanism is similar to the implementation of invalidate() of the > WebSessionV2 class. The {@link #invalidate()} action is delegated to the > genuine session. Similarly, actions setAttribute(), removeAttribute(), and > setMaxInactiveInterval() should be delegated to the genuine session. This > way, the web container can do to the session whatever it promises to do, > such as calling the HttpSessionBindingListener's valueUnbound callback > function, etc. > > If you look at the HttpSession interface, this is the whole list of APIs > concerned: > > * setAttribute() > * removeAttribute() > * setMaxInactiveInterval() > * invalidate() > * putValue() > > And putValue() has been covered by setAttribute() in WebSessionV2 > > There are two main reasons that WebSessionV2 should delegate to the genuine > session: > 1. Avoid re-inventing the wheel. The web container has already implemented > the related APIs. > 2. WebSessionV2 is not visible to the web container. When the web container > decides to expire the session, it will not reach the WebSessionV2 > implementation. And this is exactly where I had the problem in the first > place. > > By the way, thanks for pointing out removing attributes, I've made another > pull request on GitHub: > https://github.com/apache/ignite/pull/2243 > > Also I can't assign the ticket to myself because of lack of permission: > https://issues.apache.org/jira/browse/IGNITE-5607 > > > > > -- > View this message in context: http://apache-ignite- > developers.2346864.n4.nabble.com/It-seems-WebSession-s- > removeAttribute-does-not-support-HttpSessionBindingListener- > tp19184p19575.html > Sent from the Apache Ignite Developers mailing list archive at Nabble.com. > --001a113f5dfe6c90e00553c1267b--