Description
The BreadcrumbModel is held by the session (specifically, the AuthenticatedWebSessionForIsis, subclass of a Wicket session class).
This holds a list of EntityModels.
The EntityModels are LoadableDetachable, which caches the underlying ObjectAdapter in a transient field.
It seems that the model isn't being serialized/deserialized, and there is no explicit detach, thus on the next request the EntityModel still holds the ObjectAdapter (for the previous PersistenceSession) and which in turn holds the pojo. From JDO/Datanucleus' perspective, this pojo is not persistent.
As per ISIS-1194 simplificaitons, we now delegate to the pojo to determine whether it is persistent or not; and so JDO/DN reports that this pojo is NOT persistent.
In turn this gives us a "" empty string for the oid str, and things then break.
~~~
The fix is to explicitly detach all the EntityModels of the BreadcrumbModel. This can be done by hooking into the AuthenticatedWebSessionForIsis#detach() hook.