You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Martin2 <vo...@gmail.com> on 2007/10/02 20:32:28 UTC

Session size is constantly increasing on setResponsePage(getPage())

Hi there,

we're developing a rather straight forward application with wicket and I am
wondering if it is ok to call setResponsePage(getPage()) inside the
onClick() method of a Link? Because the session size is constantly
increasing, here's my example:

Application class:

public class TestApplication extends WebApplication {
	public TestApplication() {
		super();
	}
	@Override
	public Class getHomePage() {
		return TestPage.class;
	}
	@Override
	protected void init() {
		super.init();
		mountBookmarkablePage("/home", getHomePage());
	}
}

Page class:

public class TestPage extends WebPage {
	public TestPage() {
		super();
		setVersioned(false);
		add(new TestLink("testLink"));
	}
	@Override
	protected void onBeforeRender() {
		super.onBeforeRender();
		System.err.println(getSession().getSizeInBytes());
	}
}

Link class:

public class TestLink extends Link {
	public TestLink(String id) {
		super(id);
	}
	@Override
	public void onClick() {
		setResponsePage(getPage());
	}
}

Everytime the Link is clicked the session size increases a bit (it may be
tiny in this test application, it's nevertheless increasing constantly).
Whenever (this clue comes from testing our real application) a new page is
constructed (be it via setResponsePage(Page.class) or via url) the session
size falls back to normal. When an older instance (via back button or link)
is used, the session is as big as before.

I also noticed that when using TabbedPanel (from wicket-extensions) each tab
change (out of the box) increases the session size much more.

All our models are LoadableDetachableModels, so our model objects are all
transient and should never be stored in the session. Of course we use here
and there a new PropertyModel() and other wrapper models, but only in
constructors.

Any suggestion what we could do about it? In the real application the
increment is about 2-3Kb per click, which will become a problem since the
application is click-intensive and collaborative (many session at the same
time).

Thanks in advance,
Martin


-- 
View this message in context: http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13004735
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Session size is constantly increasing on setResponsePage(getPage())

Posted by Martin2 <vo...@gmail.com>.
I'm using trunk right now and the issue is resolved, the session size does
not increase anymore when setting the response page. Since this was a
critical one on our issue tracking, thanks for the quick fix.

I opened jira  https://issues.apache.org/jira/browse/WICKET-1036 WICKET-1036 
and I'll close it then.

bw,
Martin


Johan Compagner wrote:
> 
> jip, but open and close a jira if you want to have this in the change
> list..
> 
> On 10/3/07, Gerolf Seitz <ge...@gmail.com> wrote:
>>
>> i think johan already fixed it in trunk.
>>
>> gerolf
>>
>> On 10/3/07, Martin2 <vo...@gmail.com> wrote:
>> >
>> >
>> > Hi,
>> >
>> > thanks for the quick response. Should I open a JIRA issue for this or
>> is
>> > it
>> > to minor to justify the overhead?
>> >
>> > bw,
>> > Martin
>> >
>> >
>> >
>> >
>> >
>> > Johan Compagner wrote:
>> > >
>> > > ok found it, We are leaking auto add html header containers.
>> > >
>> > > Looking to fix it.
>> > >
>> > >
>> > > On 10/3/07, Johan Compagner <jc...@gmail.com> wrote:
>> > >>
>> > >> are you talking about 1.2 or 1.3?
>> > >>
>> > >> in 1.2 a session could grow a little bit because we have there max 7
>> > >> pages
>> > >> that all also can contain some version info.
>> > >>
>> > >> But as you said when you do setResponsePage(Page.class) everything
>> > drops
>> > >> to normal
>> > >> that means that you have to use 1.3 because then the newly created
>> page
>> > >> replaces the old one in the session memory.
>> > >>
>> > >> But if you set in the link click the same page that the link is on
>> > >> (setResponsePage(getPage()).  You see a grow?
>> > >>
>> > >> That seems a bit strange. need to check that out then.
>> > >>
>> > >> johan
>> > >>
>> > >>
>> > >>  On 10/2/07, Martin2 <vo...@gmail.com> wrote:
>> > >> >
>> > >> >
>> > >> > Hi there,
>> > >> >
>> > >> > we're developing a rather straight forward application with wicket
>> > and
>> > >> I
>> > >> > am
>> > >> > wondering if it is ok to call setResponsePage(getPage()) inside
>> the
>> > >> > onClick() method of a Link? Because the session size is constantly
>> > >> > increasing, here's my example:
>> > >> >
>> > >> > Application class:
>> > >> >
>> > >> > public class TestApplication extends WebApplication {
>> > >> >        public TestApplication() {
>> > >> >                super();
>> > >> >        }
>> > >> >        @Override
>> > >> >        public Class getHomePage() {
>> > >> >                return TestPage.class;
>> > >> >        }
>> > >> >        @Override
>> > >> >        protected void init() {
>> > >> >                super.init();
>> > >> >                mountBookmarkablePage("/home", getHomePage());
>> > >> >        }
>> > >> > }
>> > >> >
>> > >> > Page class:
>> > >> >
>> > >> > public class TestPage extends WebPage {
>> > >> >        public TestPage() {
>> > >> >                super();
>> > >> >                setVersioned(false);
>> > >> >                add(new TestLink("testLink"));
>> > >> >        }
>> > >> >        @Override
>> > >> >        protected void onBeforeRender() {
>> > >> >                super.onBeforeRender();
>> > >> >                System.err.println(getSession().getSizeInBytes());
>> > >> >        }
>> > >> > }
>> > >> >
>> > >> > Link class:
>> > >> >
>> > >> > public class TestLink extends Link {
>> > >> >        public TestLink(String id) {
>> > >> >                super(id);
>> > >> >        }
>> > >> >        @Override
>> > >> >        public void onClick() {
>> > >> >                setResponsePage(getPage());
>> > >> >        }
>> > >> > }
>> > >> >
>> > >> > Everytime the Link is clicked the session size increases a bit (it
>> > may
>> > >> > be
>> > >> > tiny in this test application, it's nevertheless increasing
>> > >> constantly).
>> > >> >
>> > >> > Whenever (this clue comes from testing our real application) a new
>> > page
>> > >> > is
>> > >> > constructed (be it via setResponsePage(Page.class) or via url) the
>> > >> > session
>> > >> > size falls back to normal. When an older instance (via back button
>> or
>> > >> > link)
>> > >> > is used, the session is as big as before.
>> > >> >
>> > >> > I also noticed that when using TabbedPanel (from
>> wicket-extensions)
>> > >> each
>> > >> > tab
>> > >> > change (out of the box) increases the session size much more.
>> > >> >
>> > >> > All our models are LoadableDetachableModels, so our model objects
>> are
>> > >> > all
>> > >> > transient and should never be stored in the session. Of course we
>> use
>> > >> > here
>> > >> > and there a new PropertyModel() and other wrapper models, but only
>> in
>> > >> > constructors.
>> > >> >
>> > >> > Any suggestion what we could do about it? In the real application
>> the
>> > >> > increment is about 2-3Kb per click, which will become a problem
>> since
>> > >> > the
>> > >> > application is click-intensive and collaborative (many session at
>> the
>> > >> > same
>> > >> > time).
>> > >> >
>> > >> > Thanks in advance,
>> > >> > Martin
>> > >> >
>> > >> >
>> > >> > --
>> > >> > View this message in context:
>> > >>
>> >
>> http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13004735
>> > >> >
>> > >> > Sent from the Wicket - User mailing list archive at
>> > >> Nabble.com<http://nabble.com/>
>> > >> > .
>> > >> >
>> > >> >
>> > >> >
>> ---------------------------------------------------------------------
>> > >> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > >> > For additional commands, e-mail: users-help@wicket.apache.org
>> > >> >
>> > >> >
>> > >>
>> > >
>> > >
>> >
>> > --
>> > View this message in context:
>> >
>> http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13018499
>> > Sent from the Wicket - User mailing list archive at Nabble.com.
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13021407
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Session size is constantly increasing on setResponsePage(getPage())

Posted by Johan Compagner <jc...@gmail.com>.
jip, but open and close a jira if you want to have this in the change list..

On 10/3/07, Gerolf Seitz <ge...@gmail.com> wrote:
>
> i think johan already fixed it in trunk.
>
> gerolf
>
> On 10/3/07, Martin2 <vo...@gmail.com> wrote:
> >
> >
> > Hi,
> >
> > thanks for the quick response. Should I open a JIRA issue for this or is
> > it
> > to minor to justify the overhead?
> >
> > bw,
> > Martin
> >
> >
> >
> >
> >
> > Johan Compagner wrote:
> > >
> > > ok found it, We are leaking auto add html header containers.
> > >
> > > Looking to fix it.
> > >
> > >
> > > On 10/3/07, Johan Compagner <jc...@gmail.com> wrote:
> > >>
> > >> are you talking about 1.2 or 1.3?
> > >>
> > >> in 1.2 a session could grow a little bit because we have there max 7
> > >> pages
> > >> that all also can contain some version info.
> > >>
> > >> But as you said when you do setResponsePage(Page.class) everything
> > drops
> > >> to normal
> > >> that means that you have to use 1.3 because then the newly created
> page
> > >> replaces the old one in the session memory.
> > >>
> > >> But if you set in the link click the same page that the link is on
> > >> (setResponsePage(getPage()).  You see a grow?
> > >>
> > >> That seems a bit strange. need to check that out then.
> > >>
> > >> johan
> > >>
> > >>
> > >>  On 10/2/07, Martin2 <vo...@gmail.com> wrote:
> > >> >
> > >> >
> > >> > Hi there,
> > >> >
> > >> > we're developing a rather straight forward application with wicket
> > and
> > >> I
> > >> > am
> > >> > wondering if it is ok to call setResponsePage(getPage()) inside the
> > >> > onClick() method of a Link? Because the session size is constantly
> > >> > increasing, here's my example:
> > >> >
> > >> > Application class:
> > >> >
> > >> > public class TestApplication extends WebApplication {
> > >> >        public TestApplication() {
> > >> >                super();
> > >> >        }
> > >> >        @Override
> > >> >        public Class getHomePage() {
> > >> >                return TestPage.class;
> > >> >        }
> > >> >        @Override
> > >> >        protected void init() {
> > >> >                super.init();
> > >> >                mountBookmarkablePage("/home", getHomePage());
> > >> >        }
> > >> > }
> > >> >
> > >> > Page class:
> > >> >
> > >> > public class TestPage extends WebPage {
> > >> >        public TestPage() {
> > >> >                super();
> > >> >                setVersioned(false);
> > >> >                add(new TestLink("testLink"));
> > >> >        }
> > >> >        @Override
> > >> >        protected void onBeforeRender() {
> > >> >                super.onBeforeRender();
> > >> >                System.err.println(getSession().getSizeInBytes());
> > >> >        }
> > >> > }
> > >> >
> > >> > Link class:
> > >> >
> > >> > public class TestLink extends Link {
> > >> >        public TestLink(String id) {
> > >> >                super(id);
> > >> >        }
> > >> >        @Override
> > >> >        public void onClick() {
> > >> >                setResponsePage(getPage());
> > >> >        }
> > >> > }
> > >> >
> > >> > Everytime the Link is clicked the session size increases a bit (it
> > may
> > >> > be
> > >> > tiny in this test application, it's nevertheless increasing
> > >> constantly).
> > >> >
> > >> > Whenever (this clue comes from testing our real application) a new
> > page
> > >> > is
> > >> > constructed (be it via setResponsePage(Page.class) or via url) the
> > >> > session
> > >> > size falls back to normal. When an older instance (via back button
> or
> > >> > link)
> > >> > is used, the session is as big as before.
> > >> >
> > >> > I also noticed that when using TabbedPanel (from wicket-extensions)
> > >> each
> > >> > tab
> > >> > change (out of the box) increases the session size much more.
> > >> >
> > >> > All our models are LoadableDetachableModels, so our model objects
> are
> > >> > all
> > >> > transient and should never be stored in the session. Of course we
> use
> > >> > here
> > >> > and there a new PropertyModel() and other wrapper models, but only
> in
> > >> > constructors.
> > >> >
> > >> > Any suggestion what we could do about it? In the real application
> the
> > >> > increment is about 2-3Kb per click, which will become a problem
> since
> > >> > the
> > >> > application is click-intensive and collaborative (many session at
> the
> > >> > same
> > >> > time).
> > >> >
> > >> > Thanks in advance,
> > >> > Martin
> > >> >
> > >> >
> > >> > --
> > >> > View this message in context:
> > >>
> >
> http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13004735
> > >> >
> > >> > Sent from the Wicket - User mailing list archive at
> > >> Nabble.com<http://nabble.com/>
> > >> > .
> > >> >
> > >> >
> > >> >
> ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> > For additional commands, e-mail: users-help@wicket.apache.org
> > >> >
> > >> >
> > >>
> > >
> > >
> >
> > --
> > View this message in context:
> >
> http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13018499
> > Sent from the Wicket - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>

Re: Session size is constantly increasing on setResponsePage(getPage())

Posted by Gerolf Seitz <ge...@gmail.com>.
i think johan already fixed it in trunk.

gerolf

On 10/3/07, Martin2 <vo...@gmail.com> wrote:
>
>
> Hi,
>
> thanks for the quick response. Should I open a JIRA issue for this or is
> it
> to minor to justify the overhead?
>
> bw,
> Martin
>
>
>
>
>
> Johan Compagner wrote:
> >
> > ok found it, We are leaking auto add html header containers.
> >
> > Looking to fix it.
> >
> >
> > On 10/3/07, Johan Compagner <jc...@gmail.com> wrote:
> >>
> >> are you talking about 1.2 or 1.3?
> >>
> >> in 1.2 a session could grow a little bit because we have there max 7
> >> pages
> >> that all also can contain some version info.
> >>
> >> But as you said when you do setResponsePage(Page.class) everything
> drops
> >> to normal
> >> that means that you have to use 1.3 because then the newly created page
> >> replaces the old one in the session memory.
> >>
> >> But if you set in the link click the same page that the link is on
> >> (setResponsePage(getPage()).  You see a grow?
> >>
> >> That seems a bit strange. need to check that out then.
> >>
> >> johan
> >>
> >>
> >>  On 10/2/07, Martin2 <vo...@gmail.com> wrote:
> >> >
> >> >
> >> > Hi there,
> >> >
> >> > we're developing a rather straight forward application with wicket
> and
> >> I
> >> > am
> >> > wondering if it is ok to call setResponsePage(getPage()) inside the
> >> > onClick() method of a Link? Because the session size is constantly
> >> > increasing, here's my example:
> >> >
> >> > Application class:
> >> >
> >> > public class TestApplication extends WebApplication {
> >> >        public TestApplication() {
> >> >                super();
> >> >        }
> >> >        @Override
> >> >        public Class getHomePage() {
> >> >                return TestPage.class;
> >> >        }
> >> >        @Override
> >> >        protected void init() {
> >> >                super.init();
> >> >                mountBookmarkablePage("/home", getHomePage());
> >> >        }
> >> > }
> >> >
> >> > Page class:
> >> >
> >> > public class TestPage extends WebPage {
> >> >        public TestPage() {
> >> >                super();
> >> >                setVersioned(false);
> >> >                add(new TestLink("testLink"));
> >> >        }
> >> >        @Override
> >> >        protected void onBeforeRender() {
> >> >                super.onBeforeRender();
> >> >                System.err.println(getSession().getSizeInBytes());
> >> >        }
> >> > }
> >> >
> >> > Link class:
> >> >
> >> > public class TestLink extends Link {
> >> >        public TestLink(String id) {
> >> >                super(id);
> >> >        }
> >> >        @Override
> >> >        public void onClick() {
> >> >                setResponsePage(getPage());
> >> >        }
> >> > }
> >> >
> >> > Everytime the Link is clicked the session size increases a bit (it
> may
> >> > be
> >> > tiny in this test application, it's nevertheless increasing
> >> constantly).
> >> >
> >> > Whenever (this clue comes from testing our real application) a new
> page
> >> > is
> >> > constructed (be it via setResponsePage(Page.class) or via url) the
> >> > session
> >> > size falls back to normal. When an older instance (via back button or
> >> > link)
> >> > is used, the session is as big as before.
> >> >
> >> > I also noticed that when using TabbedPanel (from wicket-extensions)
> >> each
> >> > tab
> >> > change (out of the box) increases the session size much more.
> >> >
> >> > All our models are LoadableDetachableModels, so our model objects are
> >> > all
> >> > transient and should never be stored in the session. Of course we use
> >> > here
> >> > and there a new PropertyModel() and other wrapper models, but only in
> >> > constructors.
> >> >
> >> > Any suggestion what we could do about it? In the real application the
> >> > increment is about 2-3Kb per click, which will become a problem since
> >> > the
> >> > application is click-intensive and collaborative (many session at the
> >> > same
> >> > time).
> >> >
> >> > Thanks in advance,
> >> > Martin
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13004735
> >> >
> >> > Sent from the Wicket - User mailing list archive at
> >> Nabble.com<http://nabble.com/>
> >> > .
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> > For additional commands, e-mail: users-help@wicket.apache.org
> >> >
> >> >
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13018499
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Session size is constantly increasing on setResponsePage(getPage())

Posted by Martin2 <vo...@gmail.com>.
Hi,

thanks for the quick response. Should I open a JIRA issue for this or is it
to minor to justify the overhead? 

bw,
Martin





Johan Compagner wrote:
> 
> ok found it, We are leaking auto add html header containers.
> 
> Looking to fix it.
> 
> 
> On 10/3/07, Johan Compagner <jc...@gmail.com> wrote:
>>
>> are you talking about 1.2 or 1.3?
>>
>> in 1.2 a session could grow a little bit because we have there max 7
>> pages
>> that all also can contain some version info.
>>
>> But as you said when you do setResponsePage(Page.class) everything drops
>> to normal
>> that means that you have to use 1.3 because then the newly created page
>> replaces the old one in the session memory.
>>
>> But if you set in the link click the same page that the link is on
>> (setResponsePage(getPage()).  You see a grow?
>>
>> That seems a bit strange. need to check that out then.
>>
>> johan
>>
>>
>>  On 10/2/07, Martin2 <vo...@gmail.com> wrote:
>> >
>> >
>> > Hi there,
>> >
>> > we're developing a rather straight forward application with wicket and
>> I
>> > am
>> > wondering if it is ok to call setResponsePage(getPage()) inside the
>> > onClick() method of a Link? Because the session size is constantly
>> > increasing, here's my example:
>> >
>> > Application class:
>> >
>> > public class TestApplication extends WebApplication {
>> >        public TestApplication() {
>> >                super();
>> >        }
>> >        @Override
>> >        public Class getHomePage() {
>> >                return TestPage.class;
>> >        }
>> >        @Override
>> >        protected void init() {
>> >                super.init();
>> >                mountBookmarkablePage("/home", getHomePage());
>> >        }
>> > }
>> >
>> > Page class:
>> >
>> > public class TestPage extends WebPage {
>> >        public TestPage() {
>> >                super();
>> >                setVersioned(false);
>> >                add(new TestLink("testLink"));
>> >        }
>> >        @Override
>> >        protected void onBeforeRender() {
>> >                super.onBeforeRender();
>> >                System.err.println(getSession().getSizeInBytes());
>> >        }
>> > }
>> >
>> > Link class:
>> >
>> > public class TestLink extends Link {
>> >        public TestLink(String id) {
>> >                super(id);
>> >        }
>> >        @Override
>> >        public void onClick() {
>> >                setResponsePage(getPage());
>> >        }
>> > }
>> >
>> > Everytime the Link is clicked the session size increases a bit (it may
>> > be
>> > tiny in this test application, it's nevertheless increasing
>> constantly).
>> >
>> > Whenever (this clue comes from testing our real application) a new page
>> > is
>> > constructed (be it via setResponsePage(Page.class) or via url) the
>> > session
>> > size falls back to normal. When an older instance (via back button or
>> > link)
>> > is used, the session is as big as before.
>> >
>> > I also noticed that when using TabbedPanel (from wicket-extensions)
>> each
>> > tab
>> > change (out of the box) increases the session size much more.
>> >
>> > All our models are LoadableDetachableModels, so our model objects are
>> > all
>> > transient and should never be stored in the session. Of course we use
>> > here
>> > and there a new PropertyModel() and other wrapper models, but only in
>> > constructors.
>> >
>> > Any suggestion what we could do about it? In the real application the
>> > increment is about 2-3Kb per click, which will become a problem since
>> > the
>> > application is click-intensive and collaborative (many session at the
>> > same
>> > time).
>> >
>> > Thanks in advance,
>> > Martin
>> >
>> >
>> > --
>> > View this message in context:
>> http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13004735
>> >
>> > Sent from the Wicket - User mailing list archive at
>> Nabble.com<http://nabble.com/>
>> > .
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13018499
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Session size is constantly increasing on setResponsePage(getPage())

Posted by Johan Compagner <jc...@gmail.com>.
ok found it, We are leaking auto add html header containers.

Looking to fix it.


On 10/3/07, Johan Compagner <jc...@gmail.com> wrote:
>
> are you talking about 1.2 or 1.3?
>
> in 1.2 a session could grow a little bit because we have there max 7 pages
> that all also can contain some version info.
>
> But as you said when you do setResponsePage(Page.class) everything drops
> to normal
> that means that you have to use 1.3 because then the newly created page
> replaces the old one in the session memory.
>
> But if you set in the link click the same page that the link is on
> (setResponsePage(getPage()).  You see a grow?
>
> That seems a bit strange. need to check that out then.
>
> johan
>
>
>  On 10/2/07, Martin2 <vo...@gmail.com> wrote:
> >
> >
> > Hi there,
> >
> > we're developing a rather straight forward application with wicket and I
> > am
> > wondering if it is ok to call setResponsePage(getPage()) inside the
> > onClick() method of a Link? Because the session size is constantly
> > increasing, here's my example:
> >
> > Application class:
> >
> > public class TestApplication extends WebApplication {
> >        public TestApplication() {
> >                super();
> >        }
> >        @Override
> >        public Class getHomePage() {
> >                return TestPage.class;
> >        }
> >        @Override
> >        protected void init() {
> >                super.init();
> >                mountBookmarkablePage("/home", getHomePage());
> >        }
> > }
> >
> > Page class:
> >
> > public class TestPage extends WebPage {
> >        public TestPage() {
> >                super();
> >                setVersioned(false);
> >                add(new TestLink("testLink"));
> >        }
> >        @Override
> >        protected void onBeforeRender() {
> >                super.onBeforeRender();
> >                System.err.println(getSession().getSizeInBytes());
> >        }
> > }
> >
> > Link class:
> >
> > public class TestLink extends Link {
> >        public TestLink(String id) {
> >                super(id);
> >        }
> >        @Override
> >        public void onClick() {
> >                setResponsePage(getPage());
> >        }
> > }
> >
> > Everytime the Link is clicked the session size increases a bit (it may
> > be
> > tiny in this test application, it's nevertheless increasing constantly).
> >
> > Whenever (this clue comes from testing our real application) a new page
> > is
> > constructed (be it via setResponsePage(Page.class) or via url) the
> > session
> > size falls back to normal. When an older instance (via back button or
> > link)
> > is used, the session is as big as before.
> >
> > I also noticed that when using TabbedPanel (from wicket-extensions) each
> > tab
> > change (out of the box) increases the session size much more.
> >
> > All our models are LoadableDetachableModels, so our model objects are
> > all
> > transient and should never be stored in the session. Of course we use
> > here
> > and there a new PropertyModel() and other wrapper models, but only in
> > constructors.
> >
> > Any suggestion what we could do about it? In the real application the
> > increment is about 2-3Kb per click, which will become a problem since
> > the
> > application is click-intensive and collaborative (many session at the
> > same
> > time).
> >
> > Thanks in advance,
> > Martin
> >
> >
> > --
> > View this message in context: http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13004735
> >
> > Sent from the Wicket - User mailing list archive at Nabble.com<http://nabble.com/>
> > .
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>

Re: Session size is constantly increasing on setResponsePage(getPage())

Posted by Johan Compagner <jc...@gmail.com>.
are you talking about 1.2 or 1.3?

in 1.2 a session could grow a little bit because we have there max 7 pages
that all also can contain some version info.

But as you said when you do setResponsePage(Page.class) everything drops to
normal
that means that you have to use 1.3 because then the newly created page
replaces the old one in the session memory.

But if you set in the link click the same page that the link is on
(setResponsePage(getPage()).  You see a grow?

That seems a bit strange. need to check that out then.

johan


On 10/2/07, Martin2 <vo...@gmail.com> wrote:
>
>
> Hi there,
>
> we're developing a rather straight forward application with wicket and I
> am
> wondering if it is ok to call setResponsePage(getPage()) inside the
> onClick() method of a Link? Because the session size is constantly
> increasing, here's my example:
>
> Application class:
>
> public class TestApplication extends WebApplication {
>        public TestApplication() {
>                super();
>        }
>        @Override
>        public Class getHomePage() {
>                return TestPage.class;
>        }
>        @Override
>        protected void init() {
>                super.init();
>                mountBookmarkablePage("/home", getHomePage());
>        }
> }
>
> Page class:
>
> public class TestPage extends WebPage {
>        public TestPage() {
>                super();
>                setVersioned(false);
>                add(new TestLink("testLink"));
>        }
>        @Override
>        protected void onBeforeRender() {
>                super.onBeforeRender();
>                System.err.println(getSession().getSizeInBytes());
>        }
> }
>
> Link class:
>
> public class TestLink extends Link {
>        public TestLink(String id) {
>                super(id);
>        }
>        @Override
>        public void onClick() {
>                setResponsePage(getPage());
>        }
> }
>
> Everytime the Link is clicked the session size increases a bit (it may be
> tiny in this test application, it's nevertheless increasing constantly).
> Whenever (this clue comes from testing our real application) a new page is
> constructed (be it via setResponsePage(Page.class) or via url) the session
> size falls back to normal. When an older instance (via back button or
> link)
> is used, the session is as big as before.
>
> I also noticed that when using TabbedPanel (from wicket-extensions) each
> tab
> change (out of the box) increases the session size much more.
>
> All our models are LoadableDetachableModels, so our model objects are all
> transient and should never be stored in the session. Of course we use here
> and there a new PropertyModel() and other wrapper models, but only in
> constructors.
>
> Any suggestion what we could do about it? In the real application the
> increment is about 2-3Kb per click, which will become a problem since the
> application is click-intensive and collaborative (many session at the same
> time).
>
> Thanks in advance,
> Martin
>
>
> --
> View this message in context:
> http://www.nabble.com/Session-size-is-constantly-increasing-on-setResponsePage%28getPage%28%29%29-tf4556781.html#a13004735
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>