I want to implement code where one JVM Thread had multiple Sessions, each of which updates the same Workspace.

Each session has its own sub-tree under the root node. There will be no updates that conflict (logically). There may be hanging references (briefly) but these will be handled gracefully.

Each Session will save it state once in turn (serially) after the last state change . After the last Session has done its save, then there will be a remaining single Session that will resolve paths into references across the entire Workspace. That is the first place that complete visibility of all updates is needed. Partial updates (thus, hanging references) are a pain but will be handled gracefully. There will be no Transactions and no Locking.

What are the conditions (if any) that would prevent any one of these Sessions from executing its save?

Does this change if each Sessions runs in its own Thread? In this case, it may not be possible to determine that state changes are globally complete across the set of sessions.

      -- Dan Connelly

Reply via email to