nasa/mct — pull request #214 by VWoeltjen (2013-10-10 22:49:39+00:00)
Title: [Persistence] Address issues with component refresh

Issues nasa/mct#110 and nasa/mct#134 describe issues where a component's local model (such as base display name) and references (child components) are not observed to update reflecting changes made by another user from another MCT client. Identified two root causes:

* The "last modified" field of components is used to poll for unseen changes. Polling is done in a range based on timestamps read from the database, but the field itself is set by the client. This means that differences in the client's local time (or even differences in clock time due to the time spent transacting with the database) can result in missed updates due to timestamp mismatch. This fix uses the database's timestamp (albeit from the client side, to work around some Derby limitations) to ensure that times match, and expands the polling range to account for any latency-related mismatch.
* The second-level cache used to store component references does not synchronize with updates to component spec, so stale lists of component references would continue to be return when modification had been performed at the database. This is addressed by explicitly evicting these collections when changed components are detected by polling above.

The L2 cache solution uses API specific to Hibernate, which is not ideal; a followup issue has been filed (nasa/mct#212)