// Create a StateManager to give us a means of extracting the detached info
PersistenceCapable pc = (PersistenceCapable)obj;
org.datanucleus.ObjectManager thePM = ((JDOPersistenceManager)pm).getObjectManager();
StateManager sm = StateManagerFactory.newStateManagerForDetached(thePM, pc, getObjectId(pc), null);
pc.jdoReplaceStateManager((javax.jdo.spi.StateManager) sm); // Assign this StateManager to our detached object
sm.retrieveDetachState(sm);
String[] loadedFieldNames = sm.getLoadedFieldNames();
pc.jdoReplaceStateManager(null); // Remove the StateManager from our detached object
return loadedFieldNames;