glassfish
  1. glassfish
  2. GLASSFISH-14231

ejb cache victim-selection-policy of FIFO does not work as expected

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1
    • Fix Version/s: None
    • Component/s: ejb_container
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: All

      Description

      I set the following cache settings:

      ejb-container.cache-resize-quantity - 8
      ejb-container.max-cache-size - 20
      ejb-container.cache-idle-timeout-in-seconds - 600
      ejb-container.removal-timeout-in-seconds - 5400
      ejb-container.victim-selection-policy - FIFO

      Restart the server for the settings to take effect.

      I create 11 beans and call them in a set order (0 to 10) and watch if there are
      any passivations. None take place as expected.
      I then create an extra bean and call the beans again in a set order (0 to 11)
      9 passivations take place, but I expect bean 0 to be passivated (due to FIFO),
      but it is not.

      [testng-all] Creating 11 Stateful beans...
      [testng-all] Bean 0 served by EJB ejb.cache1.EjbCacheSFSB@1510b03
      [testng-all] Bean 1 served by EJB ejb.cache1.EjbCacheSFSB@edf123
      [testng-all] Bean 2 served by EJB ejb.cache1.EjbCacheSFSB@1581448
      [testng-all] Bean 3 served by EJB ejb.cache1.EjbCacheSFSB@1e90d95
      [testng-all] Bean 4 served by EJB ejb.cache1.EjbCacheSFSB@13ac592
      [testng-all] Bean 5 served by EJB ejb.cache1.EjbCacheSFSB@6de78a
      [testng-all] Bean 6 served by EJB ejb.cache1.EjbCacheSFSB@71729c
      [testng-all] Bean 7 served by EJB ejb.cache1.EjbCacheSFSB@d5c08f
      [testng-all] Bean 8 served by EJB ejb.cache1.EjbCacheSFSB@f048dc
      [testng-all] Bean 9 served by EJB ejb.cache1.EjbCacheSFSB@b21710
      [testng-all] Bean 10 served by EJB ejb.cache1.EjbCacheSFSB@1ad3ac1
      [testng-all] done
      [testng-all] Verify that so far nothing is passivated
      [testng-all] Bean 0 passivate count = 0
      [testng-all] Bean 1 passivate count = 0
      [testng-all] Bean 2 passivate count = 0
      [testng-all] Bean 3 passivate count = 0
      [testng-all] Bean 4 passivate count = 0
      [testng-all] Bean 5 passivate count = 0
      [testng-all] Bean 6 passivate count = 0
      [testng-all] Bean 7 passivate count = 0
      [testng-all] Bean 8 passivate count = 0
      [testng-all] Bean 9 passivate count = 0
      [testng-all] Bean 10 passivate count = 0
      [testng-all] Call the beans in a predicted usage pattern:
      [testng-all]
      [testng-all] Bean[0] is called 1st (back when it was created)
      [testng-all] Bean[10] was called least recently
      [testng-all] Bean[7] is not called as much as the other beans
      [testng-all] client called bean 10 (server inst used was
      ejb.cache1.EjbCacheSFSB@1ad3ac1)
      [testng-all] client called bean 9 (server inst used was
      ejb.cache1.EjbCacheSFSB@b21710)
      [testng-all] client called bean 8 (server inst used was
      ejb.cache1.EjbCacheSFSB@f048dc)
      [testng-all] client called bean 7 (server inst used was
      ejb.cache1.EjbCacheSFSB@d5c08f)
      [testng-all] client called bean 6 (server inst used was
      ejb.cache1.EjbCacheSFSB@71729c)
      [testng-all] client called bean 5 (server inst used was
      ejb.cache1.EjbCacheSFSB@6de78a)
      [testng-all] client called bean 4 (server inst used was
      ejb.cache1.EjbCacheSFSB@13ac592)
      [testng-all] client called bean 3 (server inst used was
      ejb.cache1.EjbCacheSFSB@1e90d95)
      [testng-all] client called bean 2 (server inst used was
      ejb.cache1.EjbCacheSFSB@1581448)
      [testng-all] client called bean 1 (server inst used was
      ejb.cache1.EjbCacheSFSB@edf123)
      [testng-all] client called bean 0 (server inst used was
      ejb.cache1.EjbCacheSFSB@1510b03)
      [testng-all] client called bean 10 (server inst used was
      ejb.cache1.EjbCacheSFSB@1ad3ac1)
      [testng-all] client called bean 9 (server inst used was
      ejb.cache1.EjbCacheSFSB@b21710)
      [testng-all] client called bean 8 (server inst used was
      ejb.cache1.EjbCacheSFSB@f048dc)
      [testng-all] client called bean 7 (server inst used was
      ejb.cache1.EjbCacheSFSB@d5c08f)
      [testng-all] client called bean 6 (server inst used was
      ejb.cache1.EjbCacheSFSB@71729c)
      [testng-all] client called bean 5 (server inst used was
      ejb.cache1.EjbCacheSFSB@6de78a)
      [testng-all] client called bean 4 (server inst used was
      ejb.cache1.EjbCacheSFSB@13ac592)
      [testng-all] client called bean 3 (server inst used was
      ejb.cache1.EjbCacheSFSB@1e90d95)
      [testng-all] client called bean 2 (server inst used was
      ejb.cache1.EjbCacheSFSB@1581448)
      [testng-all] client called bean 1 (server inst used was
      ejb.cache1.EjbCacheSFSB@edf123)
      [testng-all] client called bean 0 (server inst used was
      ejb.cache1.EjbCacheSFSB@1510b03)
      [testng-all] client called bean 10 (server inst used was
      ejb.cache1.EjbCacheSFSB@1ad3ac1)
      [testng-all] client called bean 9 (server inst used was
      ejb.cache1.EjbCacheSFSB@b21710)
      [testng-all] client called bean 8 (server inst used was
      ejb.cache1.EjbCacheSFSB@f048dc)
      [testng-all] client called bean 6 (server inst used was
      ejb.cache1.EjbCacheSFSB@71729c)
      [testng-all] client called bean 5 (server inst used was
      ejb.cache1.EjbCacheSFSB@6de78a)
      [testng-all] client called bean 4 (server inst used was
      ejb.cache1.EjbCacheSFSB@13ac592)
      [testng-all] client called bean 3 (server inst used was
      ejb.cache1.EjbCacheSFSB@1e90d95)
      [testng-all] client called bean 2 (server inst used was
      ejb.cache1.EjbCacheSFSB@1581448)
      [testng-all] client called bean 1 (server inst used was
      ejb.cache1.EjbCacheSFSB@edf123)
      [testng-all] client called bean 0 (server inst used was
      ejb.cache1.EjbCacheSFSB@1510b03)
      [testng-all] client called bean 10 (server inst used was
      ejb.cache1.EjbCacheSFSB@1ad3ac1)
      [testng-all] client called bean 9 (server inst used was
      ejb.cache1.EjbCacheSFSB@b21710)
      [testng-all] client called bean 8 (server inst used was
      ejb.cache1.EjbCacheSFSB@f048dc)
      [testng-all] client called bean 6 (server inst used was
      ejb.cache1.EjbCacheSFSB@71729c)
      [testng-all] client called bean 5 (server inst used was
      ejb.cache1.EjbCacheSFSB@6de78a)
      [testng-all] client called bean 4 (server inst used was
      ejb.cache1.EjbCacheSFSB@13ac592)
      [testng-all] client called bean 3 (server inst used was
      ejb.cache1.EjbCacheSFSB@1e90d95)
      [testng-all] client called bean 2 (server inst used was
      ejb.cache1.EjbCacheSFSB@1581448)
      [testng-all] client called bean 1 (server inst used was
      ejb.cache1.EjbCacheSFSB@edf123)
      [testng-all] client called bean 0 (server inst used was
      ejb.cache1.EjbCacheSFSB@1510b03)
      [testng-all] client called bean 10 (server inst used was
      ejb.cache1.EjbCacheSFSB@1ad3ac1)
      [testng-all] client called bean 9 (server inst used was
      ejb.cache1.EjbCacheSFSB@b21710)
      [testng-all] client called bean 8 (server inst used was
      ejb.cache1.EjbCacheSFSB@f048dc)
      [testng-all] client called bean 7 (server inst used was
      ejb.cache1.EjbCacheSFSB@d5c08f)
      [testng-all] client called bean 6 (server inst used was
      ejb.cache1.EjbCacheSFSB@71729c)
      [testng-all] client called bean 5 (server inst used was
      ejb.cache1.EjbCacheSFSB@6de78a)
      [testng-all] client called bean 4 (server inst used was
      ejb.cache1.EjbCacheSFSB@13ac592)
      [testng-all] client called bean 3 (server inst used was
      ejb.cache1.EjbCacheSFSB@1e90d95)
      [testng-all] client called bean 2 (server inst used was
      ejb.cache1.EjbCacheSFSB@1581448)
      [testng-all] client called bean 1 (server inst used was
      ejb.cache1.EjbCacheSFSB@edf123)
      [testng-all] client called bean 0 (server inst used was
      ejb.cache1.EjbCacheSFSB@1510b03)
      [testng-all] Verify that STILL nothing has yet been passivated
      [testng-all] Bean 10 passivate count = 0
      [testng-all] Bean 9 passivate count = 0
      [testng-all] Bean 8 passivate count = 0
      [testng-all] Bean 7 passivate count = 0
      [testng-all] Bean 6 passivate count = 0
      [testng-all] Bean 5 passivate count = 0
      [testng-all] Bean 4 passivate count = 0
      [testng-all] Bean 3 passivate count = 0
      [testng-all] Bean 2 passivate count = 0
      [testng-all] Bean 1 passivate count = 0
      [testng-all] Bean 0 passivate count = 0
      [testng-all] Now create one more bean and call it.
      [testng-all]
      [testng-all] When it is returned to the cache some other bean should be pushed
      out!!
      [testng-all]
      [testng-all] Creating 12 Stateful beans...
      [testng-all] Bean 0 served by EJB ejb.cache1.EjbCacheSFSB@da431b
      [testng-all] Bean 1 served by EJB ejb.cache1.EjbCacheSFSB@1cd468c
      [testng-all] Bean 2 served by EJB ejb.cache1.EjbCacheSFSB@6cd243
      [testng-all] Bean 3 served by EJB ejb.cache1.EjbCacheSFSB@c8d4b4
      [testng-all] Bean 4 served by EJB ejb.cache1.EjbCacheSFSB@febb9
      [testng-all] Bean 5 served by EJB ejb.cache1.EjbCacheSFSB@1a165ca
      [testng-all] Bean 6 served by EJB ejb.cache1.EjbCacheSFSB@1e65667
      [testng-all] Bean 7 served by EJB ejb.cache1.EjbCacheSFSB@1ce9aa3
      [testng-all] Bean 8 served by EJB ejb.cache1.EjbCacheSFSB@e48504
      [testng-all] Bean 9 served by EJB ejb.cache1.EjbCacheSFSB@3ec646
      [testng-all] Bean 10 served by EJB ejb.cache1.EjbCacheSFSB@677aca
      [testng-all] Bean 11 served by EJB ejb.cache1.EjbCacheSFSB@189136d
      [testng-all] done
      [testng-all] Check that the bean which was passivated is the expected one
      [testng-all] Bean 0 passivate count = 0
      [testng-all] Bean 1 passivate count = 1
      [testng-all] Bean 2 passivate count = 1
      [testng-all] Bean 3 passivate count = 1
      [testng-all] Bean 4 passivate count = 1
      [testng-all] Bean 5 passivate count = 1
      [testng-all] Bean 6 passivate count = 1
      [testng-all] Bean 7 passivate count = 1
      [testng-all] Bean 8 passivate count = 1
      [testng-all] Bean 9 passivate count = 1
      [testng-all] Bean 10 passivate count = 0
      [testng-all] TEST_FAILED : FIFO bean was not passivated!
      [testng-all] TEST_ENDED
      [testng-all] Test case ended. Cleaning up ...

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Mahesh Kannan
            Reporter:
            anoman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: