yes Pages are not serialized in 1 go They are seperated from each other and saved as there own entity thats why you have that shared instance problem
On Thu, Mar 13, 2008 at 12:40 PM, Sebastiaan van Erk <[EMAIL PROTECTED]> wrote: > Sebastiaan van Erk wrote: > > Maurice Marrink wrote: > >> Assuming B has a reference to Page A, wont A be Serialized with B, > >> when you go to C, and both still share the same serialized object? > > > > When B is serialized, so is A, and serialization makes sure the > > instances to your object are kept shared.... > > > But when A is serialized alone (and if A does not have a reference to > > B), then when A is deserialized you'll have a copy of the instance you > > gave to B and the reference is no longer shared. > > Actually, that's how serialization would NORMALLY work. :-) I'm not > really 100% sure how Wicket serialization works (I believe a referenced > page is not serialized inline, but instead a page id is written, which > could mean you always get copies of your instances on deserialize, but > then again I'm not sure). > > In either case, even with standard serialization you would have > issues... But to be honest I've never really run into this issue with > Wicket at all... When do you have *instance* variables in a page that > point to shared objects which are not immutable? I hardly have any > instance variables (other than maybe a few Components and Spring beans). > > Regards, > Sebastiaan > > > >>> So the best thing is that you shouldnt depend on shared variablen. > >> > >> Ok so there are a lot of gotchas :) > > > > Yep! > > > >> Maurice > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> >
