You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Henning P. Schmiedehausen" <hp...@intermeta.de> on 2007/04/09 10:40:25 UTC

Re: [jira] Commented: (VELOCITY-536) Velocity Engine throws

Lei Gu <Le...@authoria.com> writes:

Can you give me a reference for that. Anyway, we will keep 1.3
compatibility for the Velocity 1.5.x series and 1.4 compatibility for
the Velocity 1.x series, so citing Java 5 is not really helping the
case. ;-)

	Best regards
		Henning


>We are on JDK 1.5 and the memory model works for DCL if combined with
>volatile key word. In JDK 1.5, volatile key word guarantees two threads see
>the variable in the same order with the same value.
>Thanks.
>-- Lei
> 

>Velocity - Dev mailing list-2 wrote:
>> 
>> 
>>     [
>> https://issues.apache.org/jira/browse/VELOCITY-536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12486071
>> ] 
>> 
>> Nathan Bubna commented on VELOCITY-536:
>> ---------------------------------------
>> 
>> But the DCL'ed block only needs to happen once per instance.  Isn't the
>> whole point to make the second thread skip the block completely?   We only
>> need one thread per instance to go through, period.   Once one thread has
>> started going through the block, it will finish and keep other threads out
>> of there for that instance, order notwithstanding.
>> 
>> And again, this is not a constructor nor a completely abstract use of DCL
>> that we're talking about.  This is a very specific use.
>> 
>>> Velocity Engine throws NullPointer Exception when two people click on the
>>> same page at the same time for the first time
>>> -----------------------------------------------------------------------------------------------------------------------
>>>
>>>                 Key: VELOCITY-536
>>>                 URL: https://issues.apache.org/jira/browse/VELOCITY-536
>>>             Project: Velocity
>>>          Issue Type: Bug
>>>          Components: Engine
>>>    Affects Versions: 1.5
>>>            Reporter: Lei Gu
>>>         Attachments: 536-patch.txt, ASTDirective.java,
>>> ASTSetDirective.java, VelocimacroProxy.java
>>>
>>>
>>> Multi-thread concurrency issue
>>> During our concurrency testing, we observed NullPointer exceptions being
>>> thrown when two people hit the same page at the same time for the first
>>> time. Upon further investigation, it turns out that we need to
>>> synchronize the init method on ASTDirective, ASTSetDirective, and render
>>> method on ASTSetDirective, and VelocimacroProxy.
>>>  Basically, the problem is introduced as the following; when two threads
>>> attempts to parse and render the same template at the same time. Thread1
>>> finishes parsing first and proceeds to the render method call, while
>>> thread 2 is still busy parsing and will overwrite the existing parse tree
>>> that is being used by thread 1 for rendering purpose. Thus under
>>> certainly condition a NullPointer exception will be 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: dev-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: dev-help@velocity.apache.org
>> 
>> 
>> 

>-- 
>View this message in context: http://www.nabble.com/-jira--Created%3A-%28VELOCITY-536%29-Velocity-Engine-throws-NullPointer-Exception-when-two-people-click-on-the-same-page-at-the-same-time-for-the-first-time-tf3506177.html#a9796621
>Sent from the Velocity - Dev mailing list archive at Nabble.com.


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

-- 
Henning P. Schmiedehausen  -- hps@intermeta.de | J2EE, Linux,               |gls
91054 Buckenhof, Germany   -- +49 9131 506540  | Apache person              |eau
Open Source Consulting, Development, Design    | Velocity - Turbine guy     |rwc
                                                                            |m k
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH - RG Fuerth, HRB 7350     |a s
Sitz der Gesellschaft: Buckenhof. Geschaeftsfuehrer: Henning Schmiedehausen |n

	       "Save the cheerleader. Save the world."

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