You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Nathan Bubna (JIRA)" <de...@velocity.apache.org> on 2011/09/12 22:03:09 UTC

[jira] [Resolved] (VELOCITY-811) Concurrency problems with rendering macros

     [ https://issues.apache.org/jira/browse/VELOCITY-811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna resolved VELOCITY-811.
-----------------------------------

       Resolution: Duplicate
    Fix Version/s: 2.x
                   1.7.x

I'd be shocked if it weren't the same as VELOCITY-776, enough so that i'm marking it as a duplicate.  Alex, can you confirm that the workarounds in VELOCITY-776 resolve the concurrency issue?  Also, please weigh in on the proposed solutions.

Anyone interested in stepping up with a patch to implement #3 in the 1.7.x branch?  Or even better, implement #5 in trunk/2.x?

> Concurrency problems with rendering macros
> ------------------------------------------
>
>                 Key: VELOCITY-811
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-811
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.7.x
>         Environment: Oracle JVM 1.6.0_26-b03 on Ubuntu 11.04
>            Reporter: Alex
>             Fix For: 1.7.x, 2.x
>
>
> When using a single instance of Velocity engine from multiple threads sometimes the macro invocation is rendered as literal (#macroName...) as opposed to rendering the macro itself.
> I looked at source code and there is at least one problem with the implementation of  VelocimacroManager.addNamespace. The code there is "strange" from the multi-threading point of view and puts an empty namespace into the ConcurrentHashMap before restoring it back. It should probably use "putIfAbsent" method instead.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org