On 8/22/07, Onno Scheffers <[EMAIL PROTECTED]> wrote: > > > > It's ok to be a control freak about it. But you should measure, not go > > by your hunch. :) > > > > You're right of course. > But since I'm currently learning, I can't help wondering at each step > where the data gets stored magically.
there is about zero magic in this. the page object you create is stored in sessionstore. that means all the components and their fields are stored in sessionstore as well. page is just an object, and it is just put into the sessionstore - thats it - no magic. all components have a detach() callback before they are put into the sessionstore. they can implement that callback in order to shed some state that can be recreated in another request. components pass this call onto their models. this is an easy way to optimize state as you go. for example there is no need to store a fully loadded database bean, because instead you can just store its pk and later recreate the state of the bean by querying by pk. as far as failover goes, which is the reason you would replicate the session across the cluster, what wicket does is a bit unique. the default disksessionstore will save off pages onto disk and only keep the current page in httpsession. that means your session is small (only contains a single page per pagemap) and you have some failover support. failover will work fine as long as this doesnt happen: user accesses node A node A crashes users presses backbutton presses link gets page expired error this happens because only the current page is kept in session. you can also replicate the diskstore for full failover support, matej is working on that and i believe there is a project somewhere. this is only really needed for "dumb" container replication. if your servlet container is smart enough to only replicate a session attribute when it has been set instead of on every request you can do just fine with httpsessionstore imho. whenever a page is changed wicket will call sessionstore.setattribute on it, but only if it changed. -igor
