Modifications to the cache are also synchronized with the cache image in the database, within the synchronization transaction. Modifications include the following additions:
A new external event added to the cache (one for each synchronization transaction).
Possibly several internally generated events.
Removal of events in cache (discard statement) are also synchronized with the database by the synchronization transaction. The persistent image of the event cache actually does not duplicate the events objects that are already present in the event queue in database: it only contains their references. XML messages that are cached include the actual body of the XML, not a reference.