You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Supun Kamburugamuva (JIRA)" <ji...@apache.org> on 2009/08/20 14:25:14 UTC

[jira] Created: (SYNAPSE-572) XSLT Mediator possibility of creating multiple Templates by mutiple threads

XSLT Mediator possibility of creating multiple Templates by mutiple threads
---------------------------------------------------------------------------

                 Key: SYNAPSE-572
                 URL: https://issues.apache.org/jira/browse/SYNAPSE-572
             Project: Synapse
          Issue Type: Improvement
            Reporter: Supun Kamburugamuva
         Attachments: synapse-572.patch

With the current code multiple threads can create the XSLT template after seeing that the cache has expired. Also we are always doing a synchronization for creating the template which can be costly. I've created a jira and attached a patch solving both these cases.

-- 
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@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Updated: (SYNAPSE-572) XSLT Mediator possibility of creating multiple Templates by mutiple threads

Posted by "Supun Kamburugamuva (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Supun Kamburugamuva updated SYNAPSE-572:
----------------------------------------

    Attachment: synapse-572_1.patch

This patch solves the problem of double checking and further improves the code.

> XSLT Mediator possibility of creating multiple Templates by mutiple threads
> ---------------------------------------------------------------------------
>
>                 Key: SYNAPSE-572
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-572
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Supun Kamburugamuva
>            Assignee: Ruwan Linton
>             Fix For: 1.3, NIGHTLY
>
>         Attachments: synapse-572.patch, synapse-572_1.patch
>
>
> With the current code multiple threads can create the XSLT template after seeing that the cache has expired. Also we are always doing a synchronization for creating the template which can be costly. 

-- 
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@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Updated: (SYNAPSE-572) XSLT Mediator possibility of creating multiple Templates by mutiple threads

Posted by "Supun Kamburugamuva (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Supun Kamburugamuva updated SYNAPSE-572:
----------------------------------------

    Description: With the current code multiple threads can create the XSLT template after seeing that the cache has expired. Also we are always doing a synchronization for creating the template which can be costly.   (was: With the current code multiple threads can create the XSLT template after seeing that the cache has expired. Also we are always doing a synchronization for creating the template which can be costly. I've created a jira and attached a patch solving both these cases.)

> XSLT Mediator possibility of creating multiple Templates by mutiple threads
> ---------------------------------------------------------------------------
>
>                 Key: SYNAPSE-572
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-572
>             Project: Synapse
>          Issue Type: Improvement
>            Reporter: Supun Kamburugamuva
>         Attachments: synapse-572.patch
>
>
> With the current code multiple threads can create the XSLT template after seeing that the cache has expired. Also we are always doing a synchronization for creating the template which can be costly. 

-- 
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@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Commented: (SYNAPSE-572) XSLT Mediator possibility of creating multiple Templates by mutiple threads

Posted by "Ruwan Linton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12746417#action_12746417 ] 

Ruwan Linton commented on SYNAPSE-572:
--------------------------------------

I don't agree, to me the first occurrence should be part of the function out put of reCreateTemplate, also this name is ambiguous the name of the method depicts that it recreates the template, but it is not, it is just a conditional check.

One more thing is that according to the flow if we are to keep the above two cases as two separate cases we should be having the second case first.

Just a few comments but this patch is very useful. I will apply the patch with the above specified changes, please have a look and verify the functionality. 

> XSLT Mediator possibility of creating multiple Templates by mutiple threads
> ---------------------------------------------------------------------------
>
>                 Key: SYNAPSE-572
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-572
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Supun Kamburugamuva
>            Assignee: Ruwan Linton
>         Attachments: synapse-572.patch
>
>
> With the current code multiple threads can create the XSLT template after seeing that the cache has expired. Also we are always doing a synchronization for creating the template which can be costly. 

-- 
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@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Resolved: (SYNAPSE-572) XSLT Mediator possibility of creating multiple Templates by mutiple threads

Posted by "Ruwan Linton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ruwan Linton resolved SYNAPSE-572.
----------------------------------

       Resolution: Fixed
    Fix Version/s: NIGHTLY
                   1.3

Fixed on the 1.3 branch as well as on the trunk.

Thanks supun for the contribution.

> XSLT Mediator possibility of creating multiple Templates by mutiple threads
> ---------------------------------------------------------------------------
>
>                 Key: SYNAPSE-572
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-572
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Supun Kamburugamuva
>            Assignee: Ruwan Linton
>             Fix For: 1.3, NIGHTLY
>
>         Attachments: synapse-572.patch
>
>
> With the current code multiple threads can create the XSLT template after seeing that the cache has expired. Also we are always doing a synchronization for creating the template which can be costly. 

-- 
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@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Reopened: (SYNAPSE-572) XSLT Mediator possibility of creating multiple Templates by mutiple threads

Posted by "Supun Kamburugamuva (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Supun Kamburugamuva reopened SYNAPSE-572:
-----------------------------------------


The patch I've submitted doesn't address the problem with double checked locking with Java.

http://www.ibm.com/developerworks/java/library/j-dcl.html

Also making a variable volatile can be costly than synchronization. So I'm submitting a new patch.

Supun.. 

> XSLT Mediator possibility of creating multiple Templates by mutiple threads
> ---------------------------------------------------------------------------
>
>                 Key: SYNAPSE-572
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-572
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Supun Kamburugamuva
>            Assignee: Ruwan Linton
>             Fix For: 1.3, NIGHTLY
>
>         Attachments: synapse-572.patch, synapse-572_1.patch
>
>
> With the current code multiple threads can create the XSLT template after seeing that the cache has expired. Also we are always doing a synchronization for creating the template which can be costly. 

-- 
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@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Commented: (SYNAPSE-572) XSLT Mediator possibility of creating multiple Templates by mutiple threads

Posted by "Ruwan Linton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12746418#action_12746418 ] 

Ruwan Linton commented on SYNAPSE-572:
--------------------------------------

Further, we no more need the recreate boolean variable, because now it is provided through a method and every time we use it we need to update the value of by calling that method, so we can directly use the method inside the conditional statement.

> XSLT Mediator possibility of creating multiple Templates by mutiple threads
> ---------------------------------------------------------------------------
>
>                 Key: SYNAPSE-572
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-572
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Supun Kamburugamuva
>            Assignee: Ruwan Linton
>         Attachments: synapse-572.patch
>
>
> With the current code multiple threads can create the XSLT template after seeing that the cache has expired. Also we are always doing a synchronization for creating the template which can be costly. 

-- 
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@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Commented: (SYNAPSE-572) XSLT Mediator possibility of creating multiple Templates by mutiple threads

Posted by "Supun Kamburugamuva (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SYNAPSE-572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12746432#action_12746432 ] 

Supun Kamburugamuva commented on SYNAPSE-572:
---------------------------------------------

I agree with your changes. Thanks for applying the patch.

Supun

> XSLT Mediator possibility of creating multiple Templates by mutiple threads
> ---------------------------------------------------------------------------
>
>                 Key: SYNAPSE-572
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-572
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Supun Kamburugamuva
>            Assignee: Ruwan Linton
>         Attachments: synapse-572.patch
>
>
> With the current code multiple threads can create the XSLT template after seeing that the cache has expired. Also we are always doing a synchronization for creating the template which can be costly. 

-- 
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@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Updated: (SYNAPSE-572) XSLT Mediator possibility of creating multiple Templates by mutiple threads

Posted by "Supun Kamburugamuva (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Supun Kamburugamuva updated SYNAPSE-572:
----------------------------------------

    Component/s: Core

> XSLT Mediator possibility of creating multiple Templates by mutiple threads
> ---------------------------------------------------------------------------
>
>                 Key: SYNAPSE-572
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-572
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Supun Kamburugamuva
>         Attachments: synapse-572.patch
>
>
> With the current code multiple threads can create the XSLT template after seeing that the cache has expired. Also we are always doing a synchronization for creating the template which can be costly. 

-- 
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@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Resolved: (SYNAPSE-572) XSLT Mediator possibility of creating multiple Templates by mutiple threads

Posted by "Supun Kamburugamuva (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Supun Kamburugamuva resolved SYNAPSE-572.
-----------------------------------------

    Resolution: Fixed

I think the current implementation is correct

> XSLT Mediator possibility of creating multiple Templates by mutiple threads
> ---------------------------------------------------------------------------
>
>                 Key: SYNAPSE-572
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-572
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Supun Kamburugamuva
>            Assignee: Ruwan Linton
>             Fix For: NIGHTLY, 2.0
>
>         Attachments: synapse-572.patch, synapse-572_1.patch
>
>
> With the current code multiple threads can create the XSLT template after seeing that the cache has expired. Also we are always doing a synchronization for creating the template which can be costly. 

-- 
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@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Updated: (SYNAPSE-572) XSLT Mediator possibility of creating multiple Templates by mutiple threads

Posted by "Supun Kamburugamuva (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Supun Kamburugamuva updated SYNAPSE-572:
----------------------------------------

    Attachment: synapse-572.patch

> XSLT Mediator possibility of creating multiple Templates by mutiple threads
> ---------------------------------------------------------------------------
>
>                 Key: SYNAPSE-572
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-572
>             Project: Synapse
>          Issue Type: Improvement
>            Reporter: Supun Kamburugamuva
>         Attachments: synapse-572.patch
>
>
> With the current code multiple threads can create the XSLT template after seeing that the cache has expired. Also we are always doing a synchronization for creating the template which can be costly. 

-- 
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@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org