On 1.12.11 12:26, Felix Meschberger wrote:
So we (thinking of Sling amongst other things) might have to adapt
our event listeners to do a Session.refresh at the beginning of the
onEvent method (in case long lived sessions are used).
For obvious reasons a snapshot-based implementation would need to
implicitly call refresh(true) on a session before delivering
observation events.
I don't think so, I would even deem it dangerous. Rather I would accept the
fact of the session not being accurate (since this is ok per the spec) and have
the listeners refresh themselves as needed.
Maybe there are listeners, that do not even use the session, with which they
have been registered in the first place. Then such a refresh by the repository
would just burn cycles to no avail.
Another approach we discussed some time ago is to have read only
sessions which are always on the newest revision (i.e. see all saved
changes). Observation listeners on such sessions would then behave as
they did with JR2. Since the underlying Microkernel implements an MVCC
approach such read only sessions would be very easy and cheap to implement.
Michael