[ 
https://issues.apache.org/jira/browse/VELOCITY-750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796226#action_12796226
 ] 

Nathan Bubna commented on VELOCITY-750:
---------------------------------------

Oops. I shouldn't just look at the trunk code when this was reported against 
1.6.   That would explain the dissonance between the user's experience and my 
understanding of the code.

And i thought we'd agreed to drop support of Java 1.3 after Velocity 1.5?  Of 
course, that still leaves Java 1.4 users with the problem.   However, let's not 
forget that there is a very simple workaround here, which is actually the way 
older code always had to do it:  manually call init and not rely on the new 
auto-init feature.   I think we just need to add volatile to the initialized 
property in the 1.6 branch and get a 1.6.4 release out.  Anyone still using an 
outdated JRE can do initialization the old way.  Does Sun even still support 
Java 1.4?

Oh, and for reference, Byron's adding of volatile was along with VELOCITY-673, 
and we've had the double-checked locking conversation about other code in 
VELOCITY-536.

> org.apache.velocity.runtime.RuntimeInstance initialization is not ThreadSafe
> ----------------------------------------------------------------------------
>
>                 Key: VELOCITY-750
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-750
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6.2, 1.6.x
>         Environment: Vista, Java 1.6
>            Reporter: Cenek Rauscher
>             Fix For: 1.6.x
>
>
> Two threads call Velocity.evaluate() method.
> Call RuntimeInstance.parse() and requireInitialization() method.
> One thread trying make initialization, set "initializing" to true and the 
> other thread does not wait until initialization is done and go on.
> At next line Parser parser = (Parser) parserPool.get() is 
> NullPointerException thrown.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to