Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-16596

[7.1.x] Mutable getAttribute(...) and setAttribute(...) combination triggers redundant cache operation when using ATTRIBUTE granularity distributed web sessions with a transactional cache

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • 7.1.6.GA
    • Clustering
    • None

    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.

      Attachments

        Issue Links

          Activity

            People

              pferraro@redhat.com Paul Ferraro
              pferraro@redhat.com Paul Ferraro
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: