You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sebastiaan van Erk (JIRA)" <ji...@apache.org> on 2007/11/05 09:49:50 UTC

[jira] Created: (WICKET-1128) Option not to use localizer cache in development mode.

Option not to use localizer cache in development mode.
------------------------------------------------------

                 Key: WICKET-1128
                 URL: https://issues.apache.org/jira/browse/WICKET-1128
             Project: Wicket
          Issue Type: New Feature
          Components: wicket
    Affects Versions: 1.3.0-beta4
         Environment: All
            Reporter: Sebastiaan van Erk


I was wondering if I could somehow turn off caching of the localizer in development mode (from the current source it doesn't look like it).

The reason I ask is because now the cache is only flushed if a resource that is being watched is changed. However:

* if you add a new properties file for a page or component after you already rendered the page once the cache is not cleared and it keeps finding the key=null entry in the cache.

* if you add your own database string resource loader, the cache is never flushed at all.

I know I can add a link to flush the localizer cache if and only if we're in development mode, but I think a Settings options could be nice to just turn off caching (my laptop is fast enough, I really don't care if it tries to resolve all the labels all the time). 

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


[jira] Commented: (WICKET-1128) Option not to use localizer cache in development mode.

Posted by "Sebastiaan van Erk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12542402 ] 

Sebastiaan van Erk commented on WICKET-1128:
--------------------------------------------

Well, the caching is fixed, but that was not really the issue anymore (or the reason why it was reopened).

The reason it was reopened is because once the property file resource is found, it is cached, and only THAT resource is cached. If the locator changes its mind about the stream it should be using, then the new stream is never loaded. (See also the linked issue 1142). Thus adding a new propertyfile MyPage_en.properties will not see the changes if a BasePage.properties existed and was already loaded when viewing MyPage.

However, since what remains is pretty much an exact duplicate of 1142 but then for property files instead of markup files, and the solution is probably exactly the same as well, so I think its probably best to close this one and just keep 1142. Only other difference between the two bugs is their severity (minor vs major). It seems kind of minor (it's a devel mode only thing, and just saves some restarts), but especially with the localization it feels kind of buggy the way it is now.

Regards,
Sebastiaan

> Option not to use localizer cache in development mode.
> ------------------------------------------------------
>
>                 Key: WICKET-1128
>                 URL: https://issues.apache.org/jira/browse/WICKET-1128
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta4
>         Environment: All
>            Reporter: Sebastiaan van Erk
>            Assignee: Juergen Donnerstag
>             Fix For: 1.3.0-rc2
>
>
> I was wondering if I could somehow turn off caching of the localizer in development mode (from the current source it doesn't look like it).
> The reason I ask is because now the cache is only flushed if a resource that is being watched is changed. However:
> * if you add a new properties file for a page or component after you already rendered the page once the cache is not cleared and it keeps finding the key=null entry in the cache.
> * if you add your own database string resource loader, the cache is never flushed at all.
> I know I can add a link to flush the localizer cache if and only if we're in development mode, but I think a Settings options could be nice to just turn off caching (my laptop is fast enough, I really don't care if it tries to resolve all the labels all the time). 

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


[jira] Commented: (WICKET-1128) Option not to use localizer cache in development mode.

Posted by "Sebastiaan van Erk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540230 ] 

Sebastiaan van Erk commented on WICKET-1128:
--------------------------------------------

Hi,

Thanks for the tip, I had not thought of that yet (nor realized that the putInCache method was intended for overriding).

However, I still would prefer that wicket would do this automatically in development mode because:

1) wicket already seems to go to some length to clear the cache when in development mode (watching resources for modification), but currently fails to notice new resources being added; so currently it seems inconsistent (I have to restart the application (sometimes) after I add a properties file, but not after I edit an existing one).

2) In development mode the strategy seems to always show the most up to date  version, currently the localizer does not adhere to this strategy...

3) It feels "buggy" the way it is now, sometimes the localized strings get updated, sometimes they don't, and it took me a while to figure out what the underlying reason was.

4) I think it would help other developers as well, rather than me personally overriding the Localizer's putIntoCache to check for devel mode and become a null operation. It is not a trivial thing to come up with (requires some knowledge of wicket internals) and personally I think it would be useful (and more consistent, see also point 2 above) if Wicket defaulted to not caching in development mode.


Regards,
Sebastiaan



> Option not to use localizer cache in development mode.
> ------------------------------------------------------
>
>                 Key: WICKET-1128
>                 URL: https://issues.apache.org/jira/browse/WICKET-1128
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta4
>         Environment: All
>            Reporter: Sebastiaan van Erk
>            Assignee: Juergen Donnerstag
>
> I was wondering if I could somehow turn off caching of the localizer in development mode (from the current source it doesn't look like it).
> The reason I ask is because now the cache is only flushed if a resource that is being watched is changed. However:
> * if you add a new properties file for a page or component after you already rendered the page once the cache is not cleared and it keeps finding the key=null entry in the cache.
> * if you add your own database string resource loader, the cache is never flushed at all.
> I know I can add a link to flush the localizer cache if and only if we're in development mode, but I think a Settings options could be nice to just turn off caching (my laptop is fast enough, I really don't care if it tries to resolve all the labels all the time). 

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


[jira] Resolved: (WICKET-1128) Option not to use localizer cache in development mode.

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

Juergen Donnerstag resolved WICKET-1128.
----------------------------------------

    Resolution: Invalid
      Assignee: Juergen Donnerstag

You may subclass Localizer, replace putIntoCache with an empty method and register your new Localizer with the application.

Juergen

> Option not to use localizer cache in development mode.
> ------------------------------------------------------
>
>                 Key: WICKET-1128
>                 URL: https://issues.apache.org/jira/browse/WICKET-1128
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta4
>         Environment: All
>            Reporter: Sebastiaan van Erk
>            Assignee: Juergen Donnerstag
>
> I was wondering if I could somehow turn off caching of the localizer in development mode (from the current source it doesn't look like it).
> The reason I ask is because now the cache is only flushed if a resource that is being watched is changed. However:
> * if you add a new properties file for a page or component after you already rendered the page once the cache is not cleared and it keeps finding the key=null entry in the cache.
> * if you add your own database string resource loader, the cache is never flushed at all.
> I know I can add a link to flush the localizer cache if and only if we're in development mode, but I think a Settings options could be nice to just turn off caching (my laptop is fast enough, I really don't care if it tries to resolve all the labels all the time). 

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


[jira] Commented: (WICKET-1128) Option not to use localizer cache in development mode.

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

Johan Compagner commented on WICKET-1128:
-----------------------------------------

i looked at the code and i think it just have to be simple
putIntoCache shouldn't do anything in developement mode. Why cache them in development mode?

What we could do if development mode is enabled we are creating a NoneCachingLocalizer and set that one. (i am against a flag, because why do
that that flag is for one run always true or false so this is better served with a sub class)

It shouldn't be needed that developers have to create a none caching cache pure for development mode. This is something what wicket should do auto,

And why would there be bugs when you cache it or not? That would be a major issue of the localize itself. It shouldn't matter at all.



> Option not to use localizer cache in development mode.
> ------------------------------------------------------
>
>                 Key: WICKET-1128
>                 URL: https://issues.apache.org/jira/browse/WICKET-1128
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta4
>         Environment: All
>            Reporter: Sebastiaan van Erk
>            Assignee: Juergen Donnerstag
>
> I was wondering if I could somehow turn off caching of the localizer in development mode (from the current source it doesn't look like it).
> The reason I ask is because now the cache is only flushed if a resource that is being watched is changed. However:
> * if you add a new properties file for a page or component after you already rendered the page once the cache is not cleared and it keeps finding the key=null entry in the cache.
> * if you add your own database string resource loader, the cache is never flushed at all.
> I know I can add a link to flush the localizer cache if and only if we're in development mode, but I think a Settings options could be nice to just turn off caching (my laptop is fast enough, I really don't care if it tries to resolve all the labels all the time). 

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


[jira] Commented: (WICKET-1128) Option not to use localizer cache in development mode.

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

Juergen Donnerstag commented on WICKET-1128:
--------------------------------------------

Not sure I understand all your comments.

1) new resource being added, such as new component etc.? I don't think this is true, since it is a cache. What happens though is that Wicket remembers that no properties file was found and doesn't check that anymore later on. It does only check if a file has been changed. This need to be improved. agreed.

2) not sure what you mean. If a property has been changed and that the new version will be used => the most up to date version. I guess the problem you are referring is the one mentioned in 1)

3) see 1

4) Not sure I agree. If new properties files got detected, than the problem would be solved. Disabling caching means the potential of finding problems with caching s delayed until deployed. I rather find bug early.

To me it all comes down to what I mentioned in 1). And until we solved that problem we may extend Localizer with a simple flag to disable caching.

Juergen

> Option not to use localizer cache in development mode.
> ------------------------------------------------------
>
>                 Key: WICKET-1128
>                 URL: https://issues.apache.org/jira/browse/WICKET-1128
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta4
>         Environment: All
>            Reporter: Sebastiaan van Erk
>            Assignee: Juergen Donnerstag
>
> I was wondering if I could somehow turn off caching of the localizer in development mode (from the current source it doesn't look like it).
> The reason I ask is because now the cache is only flushed if a resource that is being watched is changed. However:
> * if you add a new properties file for a page or component after you already rendered the page once the cache is not cleared and it keeps finding the key=null entry in the cache.
> * if you add your own database string resource loader, the cache is never flushed at all.
> I know I can add a link to flush the localizer cache if and only if we're in development mode, but I think a Settings options could be nice to just turn off caching (my laptop is fast enough, I really don't care if it tries to resolve all the labels all the time). 

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


[jira] Updated: (WICKET-1128) Option not to use localizer cache in development mode.

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

Johan Compagner updated WICKET-1128:
------------------------------------

    Fix Version/s: 1.3.0-rc2

i guess this one is fixed now enough right?
we don't do it for you (we still could do that as a standard setting but i don't care to much, it must be document right)

people can just call the localizers
public final void setEnableCache(boolean value)

now and the caching is disabled

> Option not to use localizer cache in development mode.
> ------------------------------------------------------
>
>                 Key: WICKET-1128
>                 URL: https://issues.apache.org/jira/browse/WICKET-1128
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta4
>         Environment: All
>            Reporter: Sebastiaan van Erk
>            Assignee: Juergen Donnerstag
>             Fix For: 1.3.0-rc2
>
>
> I was wondering if I could somehow turn off caching of the localizer in development mode (from the current source it doesn't look like it).
> The reason I ask is because now the cache is only flushed if a resource that is being watched is changed. However:
> * if you add a new properties file for a page or component after you already rendered the page once the cache is not cleared and it keeps finding the key=null entry in the cache.
> * if you add your own database string resource loader, the cache is never flushed at all.
> I know I can add a link to flush the localizer cache if and only if we're in development mode, but I think a Settings options could be nice to just turn off caching (my laptop is fast enough, I really don't care if it tries to resolve all the labels all the time). 

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


[jira] Commented: (WICKET-1128) Option not to use localizer cache in development mode.

Posted by "Sebastiaan van Erk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540254 ] 

Sebastiaan van Erk commented on WICKET-1128:
--------------------------------------------

Hi,

By 1) I mean adding any property files, either for the application, for a page, or for a component. The cache is not cleared and the negative caching causes the properties not to be found.

By 2) I mean that my experience in development mode in Wicket is that all changes I make anywhere are immediately visible. I'm not saying this is an official Wicket policy or anything, it's just the intuitional feel of things that I have when using Wicket.

As far as the rest goes, I mostly agree. Fixing 1) would fix 3) for the standard string resource loaders, and make the caching transparent in development mode (for the standard string resource loader) fixing 2) as well.

As far as 4 goes, I don't really know which way I'm on that. I can see your point about catching bugs early though I also feel it kind of goes against the intuition of 2); I'd be perfectly happy if 1) is fixed now that I know how to fix the caching issue for my database string resource loader. :-)

So I guess we're agreeing. Should I open a new JIRA issue for 1) or should we just reopen this one?

Regards,
Sebastiaan




> Option not to use localizer cache in development mode.
> ------------------------------------------------------
>
>                 Key: WICKET-1128
>                 URL: https://issues.apache.org/jira/browse/WICKET-1128
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta4
>         Environment: All
>            Reporter: Sebastiaan van Erk
>            Assignee: Juergen Donnerstag
>
> I was wondering if I could somehow turn off caching of the localizer in development mode (from the current source it doesn't look like it).
> The reason I ask is because now the cache is only flushed if a resource that is being watched is changed. However:
> * if you add a new properties file for a page or component after you already rendered the page once the cache is not cleared and it keeps finding the key=null entry in the cache.
> * if you add your own database string resource loader, the cache is never flushed at all.
> I know I can add a link to flush the localizer cache if and only if we're in development mode, but I think a Settings options could be nice to just turn off caching (my laptop is fast enough, I really don't care if it tries to resolve all the labels all the time). 

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


[jira] Commented: (WICKET-1128) Option not to use localizer cache in development mode.

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

Johan Compagner commented on WICKET-1128:
-----------------------------------------

i think we have more complains the other way around...
" I am changing, creating or updating my property files and i have to restart tomcat/jetty all the time"

And we could add another Big warning in the log that a NoneCachingLocalizer is set because you are in development mode...
(bla bla bla)



> Option not to use localizer cache in development mode.
> ------------------------------------------------------
>
>                 Key: WICKET-1128
>                 URL: https://issues.apache.org/jira/browse/WICKET-1128
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta4
>         Environment: All
>            Reporter: Sebastiaan van Erk
>            Assignee: Juergen Donnerstag
>
> I was wondering if I could somehow turn off caching of the localizer in development mode (from the current source it doesn't look like it).
> The reason I ask is because now the cache is only flushed if a resource that is being watched is changed. However:
> * if you add a new properties file for a page or component after you already rendered the page once the cache is not cleared and it keeps finding the key=null entry in the cache.
> * if you add your own database string resource loader, the cache is never flushed at all.
> I know I can add a link to flush the localizer cache if and only if we're in development mode, but I think a Settings options could be nice to just turn off caching (my laptop is fast enough, I really don't care if it tries to resolve all the labels all the time). 

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


[jira] Commented: (WICKET-1128) Option not to use localizer cache in development mode.

Posted by "Sebastiaan van Erk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540272 ] 

Sebastiaan van Erk commented on WICKET-1128:
--------------------------------------------

While I personally prefer a non-caching localizer on development mode, I can understand the problem Juergen has with it.

You're going to get people who make their own database string resource loader, and everything works find and dandy when they're in development mode. Then when they deploy, suddenly the strings don't update like they're expecting. They're going to complain that it's broken in deployment mode, and there's going to be a JIRA saying they want it back the old way. :-)

I think if you're doing fancy stuff like making your own string resource loaders you can also be expected to do something like the following for development mode:

		if (!isDeployment()) {
			getResourceSettings().setLocalizer(new Localizer() {
				@Override
				protected void putIntoCache(String cacheKey, String string) {
					// Do not cache.
				}
			});
		}

It's not much code, the only hassle for the developer is figuring out HOW to do this...

Regards,
Sebastiaan

> Option not to use localizer cache in development mode.
> ------------------------------------------------------
>
>                 Key: WICKET-1128
>                 URL: https://issues.apache.org/jira/browse/WICKET-1128
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta4
>         Environment: All
>            Reporter: Sebastiaan van Erk
>            Assignee: Juergen Donnerstag
>
> I was wondering if I could somehow turn off caching of the localizer in development mode (from the current source it doesn't look like it).
> The reason I ask is because now the cache is only flushed if a resource that is being watched is changed. However:
> * if you add a new properties file for a page or component after you already rendered the page once the cache is not cleared and it keeps finding the key=null entry in the cache.
> * if you add your own database string resource loader, the cache is never flushed at all.
> I know I can add a link to flush the localizer cache if and only if we're in development mode, but I think a Settings options could be nice to just turn off caching (my laptop is fast enough, I really don't care if it tries to resolve all the labels all the time). 

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


[jira] Closed: (WICKET-1128) Option not to use localizer cache in development mode.

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

Johan Compagner closed WICKET-1128.
-----------------------------------

    Resolution: Duplicate

duplicate of 1142

> Option not to use localizer cache in development mode.
> ------------------------------------------------------
>
>                 Key: WICKET-1128
>                 URL: https://issues.apache.org/jira/browse/WICKET-1128
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta4
>         Environment: All
>            Reporter: Sebastiaan van Erk
>            Assignee: Juergen Donnerstag
>             Fix For: 1.3.0-rc2
>
>
> I was wondering if I could somehow turn off caching of the localizer in development mode (from the current source it doesn't look like it).
> The reason I ask is because now the cache is only flushed if a resource that is being watched is changed. However:
> * if you add a new properties file for a page or component after you already rendered the page once the cache is not cleared and it keeps finding the key=null entry in the cache.
> * if you add your own database string resource loader, the cache is never flushed at all.
> I know I can add a link to flush the localizer cache if and only if we're in development mode, but I think a Settings options could be nice to just turn off caching (my laptop is fast enough, I really don't care if it tries to resolve all the labels all the time). 

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


[jira] Reopened: (WICKET-1128) Option not to use localizer cache in development mode.

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

Juergen Donnerstag reopened WICKET-1128:
----------------------------------------


re-opened it until problem described has been fixed.

> Option not to use localizer cache in development mode.
> ------------------------------------------------------
>
>                 Key: WICKET-1128
>                 URL: https://issues.apache.org/jira/browse/WICKET-1128
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta4
>         Environment: All
>            Reporter: Sebastiaan van Erk
>            Assignee: Juergen Donnerstag
>
> I was wondering if I could somehow turn off caching of the localizer in development mode (from the current source it doesn't look like it).
> The reason I ask is because now the cache is only flushed if a resource that is being watched is changed. However:
> * if you add a new properties file for a page or component after you already rendered the page once the cache is not cleared and it keeps finding the key=null entry in the cache.
> * if you add your own database string resource loader, the cache is never flushed at all.
> I know I can add a link to flush the localizer cache if and only if we're in development mode, but I think a Settings options could be nice to just turn off caching (my laptop is fast enough, I really don't care if it tries to resolve all the labels all the time). 

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