clarencen/lshift — Issue #115: Persist session events
Author: clarencen
Created: 2011-11-14 22:41:46+00:00
State: open

We need to persist session events for a number of use cases:

* So that not all events of all need to be kept in memory;
* It allows persistent state to be recorded against difference events (e.g. #295)
* Escalations require lifecycle context for events that occurred on a given entity over time (see #274);

A potential design for this might be:

* Tackle first:
* #269 to get domains
* #298 to clean up the session manager from scan calls
* #325 to get rid of SessionScope (potentially this might have to be part of this patch though)
* #332 to streamline different event processing
* Rename the SessionManager to be a DifferenceManager
* Everything that exits the matching manager is created as a persistent difference
* Live difference events are stored using Hibernate
* The table contains the same structure as the current SessionEvent bean, with the following change:
* The Difference has composite key based on the sequence id and domain id. It still contains the reference to the pair.

To persist differences found during a scan, the process implemented in #332 should just be made persistent.

The advantages of this technique is that it doesn't require holding all differences in memory at any point, and has processing complexity relative to the number of differences, not the number of entities.