Concepts- a live XForms document is always associated with a session
- the document may or may not be serialized in state store
Ajax requests and synchronization2011-04-06 - each document associates in the session
- each incoming Ajax request
- obtains the lock
- takes document from cache or store
- if from cache, removed from cache (takeValid())
- nobody can then remove us or evict us from cache
- tricky: the lock is also used by the cache
- philosophy: if we have the lock, we can't be evicted by another thread
- we don't want to be evicted from cache between getting the lock and between taking from the cache, otherwise we won't find the document ever again
- worst case scenario: cache may grow if nobody can be evicted, but that's ok, because soon after we take the document from the cache anyway
- performs operations
- if success, re-adds document to the cache
- if failure, don't add document to the cache
- releases lock
Fatal errorsUpon a fatal error during an Ajax request, the document is not put back into the cache.
Fatal errors should be few. As of 2011-04, there are probably too many such errors (like some XPath expressions evaluation issues). Possibly this should be relaxed a bit.
|