FreeMarkerWorker class has a bug in its caching logic
----------------------------------------------------- Key: OFBIZ-1170 URL: https://issues.apache.org/jira/browse/OFBIZ-1170 Project: OFBiz Issue Type: Bug Components: framework Reporter: Adrian Crum Priority: Minor The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-1170: ------------------------------- Attachment: FreeMarkerWorker.patch Attached patch fixes the bug. I changed the behavior to apply the user's settings just prior to the call to Template.process(). The settings changes and process call are then syncronized to the Template instance. In addition, I did some code cleanup and added JavaDoc comments. I also eliminated two unnecessary methods that were used by only one other java file. > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Reporter: Adrian Crum > Priority: Minor > Attachments: FreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-1170: ------------------------------- Affects Version/s: Release Branch 4.0 SVN trunk > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Priority: Minor > Attachments: FreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-1170: ------------------------------- Attachment: FreeMarkerWorker.patch Oops, left out an if statement. Improved patch. > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-1170: ------------------------------- Attachment: FreeMarkerWorker.patch Ack. One more fix. > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12514930 ] David E. Jones commented on OFBIZ-1170: --------------------------------------- My feedback on this: in addition to fixing the bug mentioned there is quite a bit of refactoring done here. That's totally fine, but it does make it hard to review. The best next step forward because of this is for a number of people to apply the patch and run it locally for a little while and hopefully also find a few scenarios within the scope of their concern to exercise this. To all interested: please help and review this and comment back here. > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12514988 ] Adrian Crum commented on OFBIZ-1170: ------------------------------------ David, Thank you very much for your feedback! I debated at length doing this in two steps, but it's easier for me to test and debug less cluttered code, plus I probably won't have time in the future to do this in two steps. For those who are interested in evaluating this, the only real concern I have with it is rendering templates that are a part of the content management system. Other than fixing the caching bug, that is the only place where I changed the program logic. I'm going to contact the Freemarker community about making the Template class cloneable. I believe syncronizing a clone call will be faster than the syncronizing method used in this patch. If the Template class was cloneable, then we could keep a "master copy" of the Template instance in the cache, clone it, and then apply the user's settings to the clone. > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-1170: ------------------------------- Attachment: FreeMarkerWorker.patch The Freemarker community came through with a description of the correct way to render a template in a multi-user/multi-threaded environment. Attached patch uses the recommended template rendering process. See my comments in the renderTemplate(Template template, Map context, Writer outWriter) method. > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-1170: ------------------------------- Attachment: FreeMarkerWorker.patch Oops, forgot to comment out TimeZone support after testing. > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-1170: ------------------------------- Attachment: FreeMarkerWorker.patch The refactoring broke the Freemarker <#include> directive. Attached patch simply fixes the cache bug - no refactoring. > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-1170: ------------------------------- Attachment: NewFreeMarkerWorker.patch NewFreeMarkerWorker.patch file is the refactored version that has the <#include> directive fixed. In addition, you can now do things like <#include "DataResource:10240" > and <#include "component://common/webcommon/includes/test.ftl">. So, take your pick - simple bug fix patch or new and improved patch. > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, NewFreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-1170: ------------------------------- Attachment: NewFreeMarkerWorker.patch Added a couple of JavaDoc comments and a few minor fixups. Okay, I think it's done. > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, NewFreeMarkerWorker.patch, NewFreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516233 ] Jacques Le Roux commented on OFBIZ-1170: ---------------------------------------- I got a problem with this patch in eCommerce side : 2007-07-29 19:52:47,593 (http-0.0.0.0-28080-Processor4) [ ProductStoreWorker.java:484:INFO ] getSurvey for product null 2007-07-29 19:52:51,296 (http-0.0.0.0-28080-Processor4) [ Log4JLoggerFactory.java:96 :ERROR] Method public java.io.Writer org.ofbiz.product.store.ProductStoreSurveyWrapper.render() throws org.ofbiz.content.survey.SurveyWrapper$SurveyWrapperException threw an exception when invoked on org.ofbiz.product.store.ProductStoreSurveyWrapper@6258e1 The problematic instruction: ---------- ==> ${randomSurvey.render().toString()} [on line 32, column 11 in component://ecommerce/webapp/ecommerce/content/minipoll.ftl] ---------- Java backtrace for programmers: ---------- freemarker.template.TemplateModelException: Method public java.io.Writer org.ofbiz.product.store.ProductStoreSurveyWrapper.render() throws org.ofbiz.content.survey.SurveyWrapper$SurveyWrapperException threw an exception when invoked on org.ofbiz.product.store.ProductStoreSurveyWrapper@6258e1 This problem dissapears when I revert et re-appears when I reapply the patch. > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, NewFreeMarkerWorker.patch, NewFreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516234 ] Jacques Le Roux commented on OFBIZ-1170: ---------------------------------------- I mean NewFreeMarkerWorker.patch (19 kb) > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, NewFreeMarkerWorker.patch, NewFreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516235 ] Jacques Le Roux commented on OFBIZ-1170: ---------------------------------------- No problems (at least not this one) with the correcting only patch > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, NewFreeMarkerWorker.patch, NewFreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrian Crum updated OFBIZ-1170: ------------------------------- Attachment: NewFreeMarkerWorker.patch Jacques, Thank you very much for taking the time to review these patches! Attached patch fixes the error. > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, NewFreeMarkerWorker.patch, NewFreeMarkerWorker.patch, NewFreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux reassigned OFBIZ-1170: -------------------------------------- Assignee: Jacques Le Roux > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Assignee: Jacques Le Roux > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, NewFreeMarkerWorker.patch, NewFreeMarkerWorker.patch, NewFreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517797 ] Jacques Le Roux commented on OFBIZ-1170: ---------------------------------------- I have tested the FreeMarkerWorker.patch for some times now without any problems. I have also tried the NewFreeMarkerWorker.patch without problems tonight. But I would prefer to have some other opinons before commiting it, thanks > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Assignee: Jacques Le Roux > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, NewFreeMarkerWorker.patch, NewFreeMarkerWorker.patch, NewFreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517956 ] Adrian Crum commented on OFBIZ-1170: ------------------------------------ Jacques, It would be preferable to commit the NewFreeMarkerWorker.patch because it addresses a common complaint about Freemarker templates in OFBiz - the Freemarker <#include> directive doesn't always work. In addition, the old code created a Configuration instance for every Template instance, and then put them in the Template cache. The new code shares one Configuration instance between all template instances - reducing the amount of memory used in the template cache. > FreeMarkerWorker class has a bug in its caching logic > ----------------------------------------------------- > > Key: OFBIZ-1170 > URL: https://issues.apache.org/jira/browse/OFBIZ-1170 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Adrian Crum > Assignee: Jacques Le Roux > Priority: Minor > Attachments: FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, FreeMarkerWorker.patch, NewFreeMarkerWorker.patch, NewFreeMarkerWorker.patch, NewFreeMarkerWorker.patch > > > The FreeMarkerWorker class creates an instance of the Template class, initializes it with the current user's locale, then stores it in a cache. Other users will see the template rendered in the first user's locale, regardless of their locale setting. > This can be demonstrated on the Hot Wax demo site in the WorkEffort calendar. Some elements in the screen are rendered in another locale, regardless of your current locale setting. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
Could it be released now?
Shi Yusen/Beijing Langhua Ltd. |
Free forum by Nabble | Edit this page |