You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Jan Kriesten (JIRA)" <ji...@apache.org> on 2008/04/09 10:10:24 UTC

[jira] Created: (WICKET-1501) MarkupCache.putIntoCache doesn't behave correctly!!

MarkupCache.putIntoCache doesn't behave correctly!!
---------------------------------------------------

                 Key: WICKET-1501
                 URL: https://issues.apache.org/jira/browse/WICKET-1501
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.3
            Reporter: Jan Kriesten
            Priority: Critical


'putIntoCache' checks for the locationString not to be null instead of the cacheKey!

This way you always get old markup returned instead of the freshly supplied markup which shouldn't be cached at all.

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


[jira] Commented: (WICKET-1501) MarkupCache.putIntoCache doesn't behave correctly!!

Posted by "Jan Kriesten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587093#action_12587093 ] 

Jan Kriesten commented on WICKET-1501:
--------------------------------------

I don't actually understand why the markup is loaded from the markupCache in putIntoCache at all - it's already provided as a method argument...

> MarkupCache.putIntoCache doesn't behave correctly!!
> ---------------------------------------------------
>
>                 Key: WICKET-1501
>                 URL: https://issues.apache.org/jira/browse/WICKET-1501
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.3
>            Reporter: Jan Kriesten
>            Priority: Critical
>
> 'putIntoCache' checks for the locationString not to be null instead of the cacheKey!
> This way you always get old markup returned instead of the freshly supplied markup which shouldn't be cached at all.

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


[jira] Commented: (WICKET-1501) MarkupCache.putIntoCache doesn't behave correctly!!

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587143#action_12587143 ] 

Johan Compagner commented on WICKET-1501:
-----------------------------------------

i dont get it, the method putIntoCache SHOULD check for the location string. Because that is the one that goes into the markupCache
the cacheKey doesn't go into that markupCache at all anymore that only goes into the markupKeyCache

So as far as i can see the putIntoCache method is fine. 
And why it also can return it is this:

// We don't lock the cache while loading a markup. Thus it may
				// happen that the very same markup gets loaded twice (the first
				// markup being loaded, but not yet in the cache, and another
				// request requesting the very same markup). Since markup
				// loading in avg takes less than 100ms, it is not really an
				// issue. For consistency reasons however, we should always use
				// the markup loaded first which is why it gets returned.
				markup = (Markup)markupCache.get(locationString);

So thats threadding.
putIntoCache puts the markup into the cache if not there or if it is there returns the one that is in there (the first one parsed)
If you have new stuff then that is not the place to overwrite markup. You first have to call 
public final Markup removeMarkup(final String cacheKey)



> MarkupCache.putIntoCache doesn't behave correctly!!
> ---------------------------------------------------
>
>                 Key: WICKET-1501
>                 URL: https://issues.apache.org/jira/browse/WICKET-1501
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.3
>            Reporter: Jan Kriesten
>            Assignee: Juergen Donnerstag
>            Priority: Critical
>
> 'putIntoCache' checks for the locationString not to be null instead of the cacheKey!
> This way you always get old markup returned instead of the freshly supplied markup which shouldn't be cached at all.

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


[jira] Commented: (WICKET-1501) MarkupCache.putIntoCache doesn't behave correctly!!

Posted by "Jan Kriesten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587155#action_12587155 ] 

Jan Kriesten commented on WICKET-1501:
--------------------------------------

Johan -

I return 'null' for the cacheKey of my template. That's fine. The Markup isn't cached _under_this_ key.

The problem arises because wicket caches the Markup in putIntoCache also under the locationString - which has nothing to do with the cacheKey. So, markup is cached under two keys by wicket, which leads to the problem. 

Regards, --- Jan.

> MarkupCache.putIntoCache doesn't behave correctly!!
> ---------------------------------------------------
>
>                 Key: WICKET-1501
>                 URL: https://issues.apache.org/jira/browse/WICKET-1501
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.3
>            Reporter: Jan Kriesten
>            Assignee: Juergen Donnerstag
>            Priority: Critical
>
> 'putIntoCache' checks for the locationString not to be null instead of the cacheKey!
> This way you always get old markup returned instead of the freshly supplied markup which shouldn't be cached at all.

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


[jira] Updated: (WICKET-1501) MarkupCache.putIntoCache doesn't behave correctly!!

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

Johan Compagner updated WICKET-1501:
------------------------------------

    Fix Version/s: 1.4-M1
                   1.3.4
         Assignee: Johan Compagner  (was: Juergen Donnerstag)

ahh ok so loadMarkup is the method that is incorrect.

I will fix that that putInCache is not called when cache key == null

> MarkupCache.putIntoCache doesn't behave correctly!!
> ---------------------------------------------------
>
>                 Key: WICKET-1501
>                 URL: https://issues.apache.org/jira/browse/WICKET-1501
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.3
>            Reporter: Jan Kriesten
>            Assignee: Johan Compagner
>            Priority: Critical
>             Fix For: 1.3.4, 1.4-M1
>
>
> 'putIntoCache' checks for the locationString not to be null instead of the cacheKey!
> This way you always get old markup returned instead of the freshly supplied markup which shouldn't be cached at all.

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


[jira] Closed: (WICKET-1501) MarkupCache.putIntoCache doesn't behave correctly!!

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

Johan Compagner closed WICKET-1501.
-----------------------------------

    Resolution: Fixed

> MarkupCache.putIntoCache doesn't behave correctly!!
> ---------------------------------------------------
>
>                 Key: WICKET-1501
>                 URL: https://issues.apache.org/jira/browse/WICKET-1501
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.3
>            Reporter: Jan Kriesten
>            Assignee: Johan Compagner
>            Priority: Critical
>             Fix For: 1.3.4, 1.4-M1
>
>
> 'putIntoCache' checks for the locationString not to be null instead of the cacheKey!
> This way you always get old markup returned instead of the freshly supplied markup which shouldn't be cached at all.

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


[jira] Commented: (WICKET-1501) MarkupCache.putIntoCache doesn't behave correctly!!

Posted by "Jan Kriesten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587179#action_12587179 ] 

Jan Kriesten commented on WICKET-1501:
--------------------------------------

That's what I was trying to say:

Even though cacheKey is 'null' - the markup is still cached under locationString.

Since the resulting Markup is always returned from 'putIntoCache' - the originally updated markup in the parameter to 'putIntoCache' is thrown away and replaced by the old cached one...

Regards, --- Jan.

> MarkupCache.putIntoCache doesn't behave correctly!!
> ---------------------------------------------------
>
>                 Key: WICKET-1501
>                 URL: https://issues.apache.org/jira/browse/WICKET-1501
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.3
>            Reporter: Jan Kriesten
>            Assignee: Juergen Donnerstag
>            Priority: Critical
>
> 'putIntoCache' checks for the locationString not to be null instead of the cacheKey!
> This way you always get old markup returned instead of the freshly supplied markup which shouldn't be cached at all.

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


[jira] Commented: (WICKET-1501) MarkupCache.putIntoCache doesn't behave correctly!!

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587160#action_12587160 ] 

Johan Compagner commented on WICKET-1501:
-----------------------------------------

cache keys shouldn't be the keys that go into the markpuCache
they should only go into the markupKeyCache map

Where is a cache key going into the markupCache?

it is now 2 fold you have:

Map<CacheKey,LocationString>
Map<LocationString,Markup>

that is how it should work now.



> MarkupCache.putIntoCache doesn't behave correctly!!
> ---------------------------------------------------
>
>                 Key: WICKET-1501
>                 URL: https://issues.apache.org/jira/browse/WICKET-1501
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.3
>            Reporter: Jan Kriesten
>            Assignee: Juergen Donnerstag
>            Priority: Critical
>
> 'putIntoCache' checks for the locationString not to be null instead of the cacheKey!
> This way you always get old markup returned instead of the freshly supplied markup which shouldn't be cached at all.

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


[jira] Commented: (WICKET-1501) MarkupCache.putIntoCache doesn't behave correctly!!

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587172#action_12587172 ] 

Johan Compagner commented on WICKET-1501:
-----------------------------------------

if you have a null cache key then markup cache should ignore it completely
Where is i still put into the cache even if the cache key is null?

> MarkupCache.putIntoCache doesn't behave correctly!!
> ---------------------------------------------------
>
>                 Key: WICKET-1501
>                 URL: https://issues.apache.org/jira/browse/WICKET-1501
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.3
>            Reporter: Jan Kriesten
>            Assignee: Juergen Donnerstag
>            Priority: Critical
>
> 'putIntoCache' checks for the locationString not to be null instead of the cacheKey!
> This way you always get old markup returned instead of the freshly supplied markup which shouldn't be cached at all.

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


[jira] Assigned: (WICKET-1501) MarkupCache.putIntoCache doesn't behave correctly!!

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

Juergen Donnerstag reassigned WICKET-1501:
------------------------------------------

    Assignee: Juergen Donnerstag

> MarkupCache.putIntoCache doesn't behave correctly!!
> ---------------------------------------------------
>
>                 Key: WICKET-1501
>                 URL: https://issues.apache.org/jira/browse/WICKET-1501
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.3
>            Reporter: Jan Kriesten
>            Assignee: Juergen Donnerstag
>            Priority: Critical
>
> 'putIntoCache' checks for the locationString not to be null instead of the cacheKey!
> This way you always get old markup returned instead of the freshly supplied markup which shouldn't be cached at all.

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


[jira] Commented: (WICKET-1501) MarkupCache.putIntoCache doesn't behave correctly!!

Posted by "Jan Kriesten (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587163#action_12587163 ] 

Jan Kriesten commented on WICKET-1501:
--------------------------------------

hi johan,

huh?? i have no cache key for the template - it just shall not be handled by wicket's cache system (it's already cached by freemarker and changes every request)....

so - not having a cache key means i can't lookup the locationString in the first map, right?

regards, --- jan.

> MarkupCache.putIntoCache doesn't behave correctly!!
> ---------------------------------------------------
>
>                 Key: WICKET-1501
>                 URL: https://issues.apache.org/jira/browse/WICKET-1501
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.3
>            Reporter: Jan Kriesten
>            Assignee: Juergen Donnerstag
>            Priority: Critical
>
> 'putIntoCache' checks for the locationString not to be null instead of the cacheKey!
> This way you always get old markup returned instead of the freshly supplied markup which shouldn't be cached at all.

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