the push service does not directly keep references, this happens because of the usage of anonymous classes created within the components, e.g. callbacks, eventlisteners, e.g.:

final Label label = new Label("label","");

final IPushTarget pushTarget = getTimerPushService().installPush(this);
backendService.doStuff(new ProgressListener() {
  public void onEventChange(final Event event) {
    if (pushTarget.isConnected()) {
        label.setDefaultModelObject(event.message);
        pushTarget.addComponent(label);
        pushTarget.trigger();
    }
}

=> this will work as long as the current page does not get deserialized between request. the backendService gets the listener object which in turn has a reference to the label. as long as one can not enforce during dev time that pages are really deserialized you have no really chance to encounter the problem and thus fix it.


On 02.10.2010 00:40, Igor Vaynberg wrote:
sounds wrong, no one should be keeping references to components

-igor

On Fri, Oct 1, 2010 at 3:32 PM, Sebastian<nospam...@gmx.net>  wrote:
hi,

on a local copy of Wicket I now temporarily modified the
SecondLevelCacheSessionStore class and always have the
SecondLevelCachePageMap.getLastPage() method return null. This enforces that
a freshly deserialized page object instance is used on each request.

The reason why I am doing this is that e.g. the wicketstuff wicket-push
projects keeps references to component instances in singleton services, e.g.
the TimerPushService. Modifications on these components between requests
only work as long wicket will reuse the same object instances on the next
request. Since an HTTP session may be serialized by an app server between
requests based an some 2nd level caching strategy it is important to
simulate this to detect code that relies on specific object references and
thus may break in such a case.

seb

On 01.10.2010 16:43, Igor Vaynberg wrote:

wicket already tests serialization for you in dev mode....

-igor

On Fri, Oct 1, 2010 at 5:37 AM, Sebastian<nospam...@gmx.net>    wrote:

Hi,

is it possible to configure a wicket app in a way that definitely will
use
page serialization/deserializion on each request and will not hold any
page/component instances between requests in memory? I'd like to use this
during development time to test some aspects of my wicket components.

regards,
seb





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to