/** * Method to clear all loaded flags on the object. **/ public void clearLoadedFlags() { jdoFlags = PersistenceCapable.LOAD_REQUIRED; myPC.jdoReplaceFlags(); clearFlags(loadedFields); }
public void evictFromTransaction() { myPM.evictFromTransaction(this); /* * A non-transactional object needs to contact us on any field read no * matter what fields are loaded. */ jdoFlags = PersistenceCapable.LOAD_REQUIRED; myPC.jdoReplaceFlags(); }
public void enlistInTransaction() { myPM.enlistInTransaction(this); if (jdoFlags == PersistenceCapable.LOAD_REQUIRED && isDFGLoaded()) { /* * A transactional object whose DFG fields are loaded does not need * to contact us in order to read those fields. */ jdoFlags = PersistenceCapable.READ_OK; myPC.jdoReplaceFlags(); } }
/** * Method to restore all fields of the object. **/ public void restoreFields() { if (savedImage != null) { loadedFields = savedLoadedFields; jdoFlags = savedFlags; myPC.jdoReplaceFlags(); myPC.jdoCopyFields(savedImage, allFieldNumbers); clearDirtyFlags(); clearSavedFields(); } }
myPC.jdoReplaceFlags();
/** * Constructor for creating SM instances to manage PersistenceCapable objects in detached state * @param pm PersistenceManager * @param apiAdapter the ApiAdapter * @param pc the detach object. * @param cmd the AbstractClassMetaData * @param id the JDO identity of the object. * @param version the detached version * @since 1.1 */ public StateManagerImpl(PersistenceManager pm, ApiAdapter apiAdapter, PersistenceCapable pc, AbstractClassMetaData cmd, Object id, Object version) { this.cmd = cmd; this.myID = id; this.myPC = pc; this.myPM = pm; this.myFP = null; this.srm = null; setVersion(version); // This lifecycle state is not always correct. It is certainly "detached" // but we dont know if it is CLEAN or DIRTY. We need this setting here since all objects // have a lifecycle state and other methods e.g isPersistent() depend on it. this.myLC = apiAdapter.getLifeCycleState(LifeCycleState.DETACHED_CLEAN); this.myPC.jdoReplaceFlags(); initialize(); }
/** * Method to disconnect any cloned persistence capable objects from their * StateManager. * @param pc The PersistenceCapable object * @return Whether the object was disconnected. **/ private boolean disconnectClone(PersistenceCapable pc) { if (detaching) { return false; } if (pc != myPC) { if (JPOXLogger.JDO.isDebugEnabled()) { JPOXLogger.JDO.debug(LOCALISER.msg("StateManager.DisconnectClone", StringUtils.toJVMIDString(pc), this)); } // Reset jdoFlags in the clone to PersistenceCapable.READ_WRITE_OK // and clear its state manager. pc.jdoReplaceFlags(); pc.jdoReplaceStateManager(null); return true; } else { return false; } }
pcCopy.jdoReplaceFlags(); pcCopy.jdoReplaceStateManager(null);
myPC.jdoReplaceFlags();
myPC.jdoReplaceFlags();
detachedPC.jdoReplaceFlags(); ((Detachable)detachedPC).jdoReplaceDetachedState();
myPC.jdoReplaceFlags(); ((Detachable)myPC).jdoReplaceDetachedState();
myPC.jdoReplaceFlags();