Creating ghosts from scratch, as opposed to ghostifying a non-ghost
is rather tricky. IPeristent doesn’t
really provide the right interface given that:

_p_deactivate() and _p_invalidate() are overridable, and
could assume that the object’s state is properly initialized.

Assigning _p_changed to None just calls _p_deactivate().

Deleting _p_changed just calls _p_invalidate().

Note

The current cache implementation is intimately tied up with the
persistence implementation and has internal access to the persistence
state. The cache implementation can update the persistence state for
newly created and ininitialized objects directly.

The future persistence and cache implementations will be far more
decoupled. The persistence implementation will only manage object
state and generate object-usage events. The cache implemnentation(s)
will be rersponsible for managing persistence-related (meta-)state,
such as _p_state, _p_changed, _p_oid, etc. So in that future
implemention, the cache will be more central to managing object
persistence information.