Hi,

I have this scenario:

- browser requests some time-expensive page
- page renders lazy component (instead of regular component) and starts
thread for computation data
- lazy component use Behavior with AJAX callback, timed in seconds
- user sees in browser indicator
- when Behavior fires, checks thread is done
- if thread is done, renders proper component via AJAX with fresh data
- if thread is pending, renders javascript to postpone AJAX callback again

My problem:

There are some serializable fields in page, which are accessed from thread.
These fields are properly synchronized. Each AJAX response from
Behavior causes page serialization -- this runs in context of AJAX request
in the end. But in same time, thread can also access these fields in page
(typically add/remove items from collections) and serialization can throw
ConcurrentModificationException. Again, access to fields is synchronized,
but during serialization there are no chance to synchronizing access to
fields.

Are there some techniques/patterns how to solve this?

For example, can I inject Wicket page serialization to block access to
fields for my thread?

Thanks

Martin

Reply via email to