You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Jason Pyeron (JIRA)" <ji...@apache.org> on 2011/06/03 17:29:47 UTC
[jira] [Commented] (WW-3637) Auto reload of properties slowing down
application
[ https://issues.apache.org/jira/browse/WW-3637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13043404#comment-13043404 ]
Jason Pyeron commented on WW-3637:
----------------------------------
Trying to understand this.
Are you saying that the reloadBundles() is being called too many times per request?
or
Are you saying that calling clear() on the bundlesMap is broken/bad?
> Auto reload of properties slowing down application
> --------------------------------------------------
>
> Key: WW-3637
> URL: https://issues.apache.org/jira/browse/WW-3637
> Project: Struts 2
> Issue Type: Bug
> Components: Other
> Affects Versions: 2.2.3
> Environment: Centos 5.6, Tomcat-6.0.32, Eclipse Helios
> Reporter: Greg Huber
>
> 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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira