Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3637

Auto reload of properties slowing down application

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.3
    • Fix Version/s: 2.3.1
    • Component/s: Other
    • Labels:
      None
    • Environment:

      Centos 5.6, Tomcat-6.0.32, Eclipse Helios

      Description

      Hello, with this mod WW-3602

      private static void reloadBundles() {
      ..
      bundlesMap.clear();
      ..
      }

      and mod and struts.devMode=true for me, my app is now so slow its unusable. When submit a page with bundlesMap.clear(); it takes 9 seconds, and when I comment out the line it takes 1 second. The reloadBundles() gets called many times per invocation.

      I also needed to reload the messages but had to do a work around from my app to call explicitly to remove the resource bundle only once.

      LocalizedTextUtil.removeBundle("ApplicationResources_en_GB");

      modified LocalizedTextUtil added method :

      public static void removeBundle(String resourceBundle) {
      if (reloadBundles) {

      if (bundlesMap.containsKey(resourceBundle)) {
      bundlesMap.remove(resourceBundle);
      }
      }
      }

      From when I last looked at this, what I think it does is to reload the bundles after each time the call to reloadBundles() to get the message from the say UI. Since for me it gets called 20+ times, it has to reload all the bundles this many times per invocation, taking a long time. bundlesMap.clear(); would work if it was called only once at the very start of the invocation. I gave up in the end and did the work around as it was quicker than restarting Tomcat each time.

      Cheers Greg.

        Attachments

          Activity

            People

            • Assignee:
              maurizio.cucchiara Maurizio Cucchiara
              Reporter:
              ghuber Greg Huber
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: