/** * This operation activates an object. Activation of an object may entail * loading its passive state from the object store and unpacking it into the * memory resident form, or it may simply be a no-op. Full activation is * only necessary if the object is currently marked as being PASSIVE (that * is, the object was constructed as being of type ANDPERSISTENT with an * existing uid and has not already been activated). Objects that are not of * type ANDPERSISTENT or are persistent but have not yet been saved in an * object store (so-called new persistent objects) are unaffected by this * function. Returns false if PASSIVE object cannot be loaded from object * store, true otherwise. The root of the object store is taken as * <code>null</code>. * * @return <code>true</code> on success, <code>false</code> otherwise. * @see com.arjuna.ats.arjuna.objectstore.ObjectStore */ public boolean activate () { return activate(null); }
/** * Make sure the object store is set up, if required. The root of the object * store is assumed to be <code>null</code>. */ protected final void setupStore () { setupStore(null); }
public ActivationRecord(int st, StateManager sm, BasicAction action) { super(sm.get_uid(), sm.type(), ObjectType.ANDPERSISTENT); objectAddr = sm; actionHandle = action; state = st; if (tsLogger.logger.isTraceEnabled()) { tsLogger.logger.trace("ActivationRecord::ActivationRecord(" + state + ", " + sm.get_uid() + ")"); } }
/** * This constructor is used to create a new instance of a RecoveryRecord. */ public RecoveryRecord(OutputObjectState os, StateManager sm) { super(sm.get_uid(), sm.type(), ObjectType.ANDPERSISTENT); if (tsLogger.logger.isDebugEnabled()) { tsLogger.logger.debug("RecoveryRecord::RecoveryRecord(" + os + ", " + sm.get_uid() + ")"); } objectAddr = sm; state = os; actionHandle = BasicAction.Current(); }
if ((super.objectType() == ObjectType.RECOVERABLE) && (super.objectModel == ObjectModel.SINGLE)) return super.modified(); BasicAction action = BasicAction.Current(); if ((super.objectType() == ObjectType.NEITHER) || (super.status() == ObjectStatus.DESTROYED)) /* NEITHER => no recovery info */ if (super.status() == ObjectStatus.PASSIVE) { tsLogger.i18NLogger.warn_StateManager_10(); if ((modifyingActions.size() > 0) && (modifyingActions.get(action.get_uid()) != null)) modifyingActions.put(action.get_uid(), action); OutputObjectState state = new OutputObjectState(objectUid, type()); int rStatus = AddOutcome.AR_ADDED; TxLogWritePersistenceRecord record = new TxLogWritePersistenceRecord(state, super.getStore(), this); if ((rStatus = action.add(record)) != AddOutcome.AR_ADDED)
BasicAction action = BasicAction.Current(); if (action.add(dr) != AddOutcome.AR_ADDED) { dr = null; tsLogger.i18NLogger.warn_StateManager_6(action.get_uid()); result = participantStore.remove_committed(get_uid(), type()); destroyed(); tsLogger.i18NLogger.warn_StateManager_7(e); tsLogger.i18NLogger.warn_StateManager_8();
topLevelState = new OutputObjectState(sm.get_uid(), sm.type()); if (writeToLog || (!targetParticipantStore.fullCommitNeeded() && (sm.save_state(topLevelState, ObjectType.ANDPERSISTENT)) && (topLevelState.size() <= PersistenceRecord.MAX_OBJECT_SIZE))) OutputObjectState dummy = new OutputObjectState(Uid.nullUid(), null); targetParticipantStore.write_uncommitted(sm.get_uid(), sm.type(), dummy); result = TwoPhaseOutcome.PREPARE_OK; tsLogger.i18NLogger.warn_PersistenceRecord_21(e); if (sm.deactivate(targetParticipantStore.getStoreName(), false)) tsLogger.i18NLogger.warn_PersistenceRecord_7(); tsLogger.i18NLogger.warn_PersistenceRecord_8();
|| loadObjectState()) setupStore(rootName); String tn = type(); OutputObjectState newState = new OutputObjectState(objectUid, tn); if (save_state(newState, myType)) result = participantStore.write_committed(objectUid, tn, newState); else result = participantStore.write_uncommitted(objectUid, tn, newState); tsLogger.i18NLogger.warn_StateManager_3(e); tsLogger.i18NLogger.warn_StateManager_4();
BasicAction action = BasicAction.Current(); packHeader(os, new Header(null, Utility.getProcessUid())); else packHeader(os, new Header(action.get_uid(), Utility.getProcessUid()));
if (!txId.equals(Uid.nullUid())) processUid = UidHelper.unpackFrom(os); tsLogger.i18NLogger.warn_StateManager_9(); throw new IOException(tsLogger.i18NLogger.get_StateManager_15()); tsLogger.logger.trace("StateManager.unpackHeader for object-id " + get_uid() + " birth-date " + birthDate);
public DisposeRecord (ParticipantStore participantStore, StateManager sm) { super(null, participantStore, sm); this.targetParticipantStore = participantStore; if (sm != null) { objectUid = sm.get_uid(); typeName = sm.type(); } else { objectUid = Uid.nullUid(); typeName = null; } if (tsLogger.logger.isTraceEnabled()) { tsLogger.logger.trace("DisposeRecord::DisposeRecord(" + participantStore + ", " + objectUid + ")"); } }
os.packString(StateManager.marker); UidHelper.packInto(Uid.nullUid(), os); tsLogger.logger.trace("StateManager.packHeader for object-id " + get_uid() + " birth-date " + birthDate); os.packLong(birthDate);
/** * This operation deactivates a persistent object. It behaves in a similar * manner to the activate operation, but has an extra argument which defines * whether the object's state should be commited now or not. It is assumed * that this is being called during a transaction commit. * * @return <code>true</code> on success, <code>false</code> otherwise. */ public boolean deactivate (String rootName) { return deactivate(rootName, true); }
public CadaverActivationRecord (StateManager sm) { super(ObjectStatus.PASSIVE, sm, null); if (tsLogger.logger.isTraceEnabled()) { tsLogger.logger.trace("CadaverActivationRecord::CadaverActivationRecord(" + sm.get_uid() + ")"); } }
if ((super.objectType() == ObjectType.RECOVERABLE) && (super.objectModel == ObjectModel.SINGLE)) return super.modified(); BasicAction action = BasicAction.Current(); if ((super.objectType() == ObjectType.NEITHER) || (super.status() == ObjectStatus.DESTROYED)) /* NEITHER => no recovery info */ if (super.status() == ObjectStatus.PASSIVE) { tsLogger.i18NLogger.warn_StateManager_10(); if ((modifyingActions.size() > 0) && (modifyingActions.get(action.get_uid()) != null)) modifyingActions.put(action.get_uid(), action); OutputObjectState state = new OutputObjectState(objectUid, type()); int rStatus = AddOutcome.AR_ADDED; TxLogWritePersistenceRecord record = new TxLogWritePersistenceRecord(state, super.getStore(), this); if ((rStatus = action.add(record)) != AddOutcome.AR_ADDED)
BasicAction action = BasicAction.Current(); if (action.add(dr) != AddOutcome.AR_ADDED) { dr = null; tsLogger.i18NLogger.warn_StateManager_6(action.get_uid()); result = participantStore.remove_committed(get_uid(), type()); destroyed(); tsLogger.i18NLogger.warn_StateManager_7(e); tsLogger.i18NLogger.warn_StateManager_8();
topLevelState = new OutputObjectState(sm.get_uid(), sm.type()); if (writeToLog || (!targetParticipantStore.fullCommitNeeded() && (sm.save_state(topLevelState, ObjectType.ANDPERSISTENT)) && (topLevelState.size() <= PersistenceRecord.MAX_OBJECT_SIZE))) OutputObjectState dummy = new OutputObjectState(Uid.nullUid(), null); targetParticipantStore.write_uncommitted(sm.get_uid(), sm.type(), dummy); result = TwoPhaseOutcome.PREPARE_OK; tsLogger.i18NLogger.warn_PersistenceRecord_21(e); if (sm.deactivate(targetParticipantStore.getStoreName(), false)) tsLogger.i18NLogger.warn_PersistenceRecord_7(); tsLogger.i18NLogger.warn_PersistenceRecord_8();
|| loadObjectState()) setupStore(rootName); String tn = type(); OutputObjectState newState = new OutputObjectState(objectUid, tn); if (save_state(newState, myType)) result = participantStore.write_committed(objectUid, tn, newState); else result = participantStore.write_uncommitted(objectUid, tn, newState); tsLogger.i18NLogger.warn_StateManager_3(e); tsLogger.i18NLogger.warn_StateManager_4();
BasicAction action = BasicAction.Current(); packHeader(os, new Header(null, Utility.getProcessUid())); else packHeader(os, new Header(action.get_uid(), Utility.getProcessUid()));