Broker broker = sm.getBroker();
preDetach(broker, sm, idxs, false, true);
// write detached state object and state manager
DetachOptions opts = broker.getConfiguration().
getDetachStateInstance();
if (!opts.getDetachedStateManager()
|| !useDetachedStateManager(sm, opts)) {
out.writeObject(getDetachedState(sm, idxs));
out.writeObject(null);
return false;
}
out.writeObject(null);
out.writeObject(new DetachedStateManager(sm.getPersistenceCapable(),
sm, idxs, opts.getAccessUnloaded(), broker.getMultithreaded()));
return true;
}