[jboss-jira] [JBoss JIRA] (WFLY-11882) Mutable getAttribute(...) and setAttribute(...) combination triggers redundant cache operation when using ATTRIBUTE granularity distributed web sessions with a transactional cache

Paul Ferraro (Jira) issues at jboss.org
Wed Mar 20 18:06:00 EDT 2019


     [ https://issues.jboss.org/browse/WFLY-11882?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Ferraro updated WFLY-11882:
--------------------------------
    Description: 
When using a transactional cache with ATTRIBUTE granularity, the following code will trigger a redundant cache operation upon request completion:

[1]
AtomicInteger value = (AtomicInteger) session.getAttribute("a");
value.incrementAndGet();
session.setAttribute("a", value);

[2]
session.setAttribute("a", new AtomicInteger());
AtomicInteger value = (AtomicInteger) session.getAttribute("a");
value.incrementAndGet();

In case [1], the initial mutable getAttribute(...) triggers an eager mutate, which becomes redundant by the subsequent setAttribute(...).
In case [2], the subsequent mutable getAttribute(...) does not need to trigger a mutation, as the previous setAttribute(...) already has.

  was:
When using a transactional cache with ATTRIBUTE granularity, the following code triggers a redundant cache operation upon request completion:

session.getAttribute("a");
session.setAttribute("a", new AtomicInteger());

or

session.setAttribute("a", new AtomicInteger());
session.getAttribute("a");



> Mutable getAttribute(...) and setAttribute(...) combination triggers redundant cache operation when using ATTRIBUTE granularity distributed web sessions with a transactional cache
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WFLY-11882
>                 URL: https://issues.jboss.org/browse/WFLY-11882
>             Project: WildFly
>          Issue Type: Bug
>          Components: Clustering
>    Affects Versions: 16.0.0.Final
>            Reporter: Paul Ferraro
>            Assignee: Paul Ferraro
>            Priority: Major
>
> When using a transactional cache with ATTRIBUTE granularity, the following code will trigger a redundant cache operation upon request completion:
> [1]
> AtomicInteger value = (AtomicInteger) session.getAttribute("a");
> value.incrementAndGet();
> session.setAttribute("a", value);
> [2]
> session.setAttribute("a", new AtomicInteger());
> AtomicInteger value = (AtomicInteger) session.getAttribute("a");
> value.incrementAndGet();
> In case [1], the initial mutable getAttribute(...) triggers an eager mutate, which becomes redundant by the subsequent setAttribute(...).
> In case [2], the subsequent mutable getAttribute(...) does not need to trigger a mutation, as the previous setAttribute(...) already has.



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the jboss-jira mailing list