a page should definitely not be serialized twice per request, i'll
look at it right now.

as for (2), it is necessary to serialize page after every request.
Version manager can track soem changes, but not all of them (consider
simple counter examples that does count++ - version manager is not
involved). So there are some changes (such as components
adding/removal) that we can track, and changes that we can't. But we
still need to have the most recent version saved.

-Matej

On 6/29/07, Jan Vermeulen <[EMAIL PROTECTED]> wrote:

I have been debugging the FilePageStore behavior, and I came across the
following things that surprised me:

(1) a page (with the same id & versionNumber) gets serialized 2x when a new
version has been ended:

* at the moment the SecondLevelCachePageVersionManager.endVersion() is
called, it stores the page in the pageStore, causing that page to be added
to the list of 'pagesToSerialize' in the FilePageStore.
* that same page has been 'touched', so it has been added to the list of
'touchedPages' in the session. All pages in that list get stored in the
pageMap, causing that page to be added a second time to the list of
'pagesToSerialize' in the FilePageStore.

Isn't this a bug ? I simply changed the endVersion() of the
SecondLevelCachePageVersionManager to call Session.touch(page) instead of
'hard-adding' it to the pageStore, and gone was the problem.

(2) when a page is restored from the pageMap in Session.getPage(), that page
is attached (which I understand), but it is also 'touched' (which I don't
understand). Consequence of this is that when a page is restored from the
store, it will automatically be saved to the store again at the end of the
request, independent of the fact if any state on the page has changed. Isn't
it the job of the versionManager to track state changes in the page, and
assure that it gets added to the store is anything has changed ?

I might miss something important why these things are happening, so my
question is: is this correct ?

Jan.
--
View this message in context: 
http://www.nabble.com/PageStore-serializes-more-than-needed---tf4001053.html#a11364087
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Reply via email to