TransferFieldManager fm = new TransferFieldManager();
for (StateManagerImpl sm : states) {
ClassMetaData cmd = sm.getMetaData();
if (sm.isPersistent() && cmd.isDetachable()) {
PersistenceCapable pc = sm.getPersistenceCapable();
if (pc.pcIsDetached() == false) {
// Detach proxy fields.
BitSet loaded = sm.getLoaded();
for (FieldMetaData fmd : cmd.getProxyFields()) {
if (loaded.get(fmd.getIndex())) {
detachProxyField(fmd, pc, sm, fm);