HP Integrity NonStop J-Series User Manual

Page 179

Advertising
background image

as they did in the original collection.

Figure 2. Saving and restoring with simple persistence.

Figure 3. Saving and Restoring a Collection with Isomorphic Persistence

In Figure 4, we attempt to save and restore a circularly-linked list, using simple persistence. As shown
in the figure, any attempt to use simple persistence to save a circularly-linked list results in an infinite
loop.

The simple persistence mechanism creates a copy of each object that is pointed to and saves that
object to a stream. But the simple persistence mechanism doesn't remember which objects it has
already saved. When the simple persistence mechanism encounters a pointer, it has no way of
knowing whether it has already saved that pointer's object. So in a circularly-linked list, the simple
persistence mechanism saves the same objects over and over and over as the mechanism cycles
through the list forever.

On the other hand, as shown in Figure 5, isomorphic persistence allows us to save the
circularly-linked list. The isomorphic persistence mechanism uses a table to keep track of pointers it

Advertising
This manual is related to the following products: