Uploaded image for project: 'Apache DirectMemory'
  1. Apache DirectMemory
  2. DIRECTMEMORY-84

Cache should not be a private DirectMemoryServlet field and initialized in init methods

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 0.1-incubating
    • Fix Version/s: None
    • Component/s: REST Server
    • Labels:

      Description

      The cache should not be a private DirectMemoryServlet field as there is nothing per the Servlet spec that prevents the Servlet container to hold several instances of the same servlet class. This may lead to memory consumption (as the cache may be created several times) and unexpected behaviour (as one instance may put the object in ITS cache and another one try to retrieve it and either no finding it or returning another object !!!!).
      It should be a Servlet context attribute and managed through the ServletContextListener pattern.
      As soon as I have completed the work i'm doing on the Closeable stuff, I'm will submit the fix

        Attachments

          Activity

            People

            • Assignee:
              olamy Olivier Lamy (*$^¨%`£)
              Reporter:
              jeffmaury Jeff MAURY
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: