/** * The nested transaction has aborted. Invalidate any new state. */ public int topLevelAbort () { if (tsLogger.logger.isTraceEnabled()) { tsLogger.logger.trace("CadaverRecord::topLevelAbort() for " + order()); } newStateIsValid = false; if (oType == RecordType.RECOVERY) { tsLogger.i18NLogger.warn_CadaverRecord_1(order(), getTypeOfObject()); } // super.forgetAction(false); return TwoPhaseOutcome.FINISH_OK; }
public void print (PrintWriter strm) { strm.println("Dispose for:"); super.print(strm); }
public boolean save_state (OutputObjectState os, int ot) { boolean res = true; if ((targetParticipantStore != null) && (objectUid.notEquals(Uid.nullUid()))) { try { UidHelper.packInto(objectUid, os); os.packString(typeName); res = (res && super.save_state(os, ot)); } catch (IOException e) { tsLogger.i18NLogger.warn_DisposeRecord_2(); res = false; } } else { tsLogger.i18NLogger.warn_DisposeRecord_3(); res = false; } return res; }
/** * Overrides AbstractRecord.shouldMerge * * @param ar the record to potentially merge with. * * @return <code>true</code> if this instance and the parameter have the * same id (order()) and the parameter is either persistent or recoverable. * <code>false</code> otherwise. * @see com.arjuna.ats.arjuna.coordinator.RecordType */ public boolean shouldMerge (AbstractRecord ar) { return (((order().equals(ar.order())) && ((ar.typeIs() == RecordType.PERSISTENCE) || (ar.typeIs() == RecordType.RECOVERY))) ? true : false); }
oType = mergewith.typeIs(); setValue(oldState); newStateIsValid = true; oldState = new OutputObjectState((OutputObjectState)(mergewith.value()));
OutputObjectState state = null; tsLogger.i18NLogger.warn_StateManager_11(objectUid, type()); state = new OutputObjectState(objectUid, type()); tsLogger.i18NLogger.warn_StateManager_12(); record = new CadaverRecord(state, participantStore, this); tsLogger.i18NLogger.warn_StateManager_6(action.get_uid());
tsLogger.logger.trace("CadaverRecord::topLevelPrepare() for " + order()); if (targetParticipantStore.write_uncommitted(oState.stateUid(), oState.type(), oState)) if (shadowForced()) tlpOk = TwoPhaseOutcome.PREPARE_OK;
/** * At topLevelCommit we commit the uncommitted version already saved * into object participantStore. * Cannot use inherited version since that assumes object is alive * instead talk directly to the object participantStore itself. */ public int topLevelCommit () { if (tsLogger.logger.isTraceEnabled()) { tsLogger.logger.trace("CadaverRecord::topLevelCommit() for " + order()); } boolean res = true; OutputObjectState oState = super.state; if ((oState != null) && (oType == RecordType.PERSISTENCE)) { if (targetParticipantStore == null) return TwoPhaseOutcome.FINISH_ERROR; try { res = targetParticipantStore.commit_state(oState.stateUid(), oState.type()); } catch (ObjectStoreException e) { res = false; } } // super.forgetAction(false); return ((res) ? TwoPhaseOutcome.FINISH_OK : TwoPhaseOutcome.FINISH_ERROR); }
state = new OutputObjectState(objectUid, type()); record = new CadaverRecord(state, objectStore, this);
public boolean restore_state (InputObjectState os, int ot) { boolean res = true; try { objectUid = UidHelper.unpackFrom(os); typeName = os.unpackString(); res = (res && super.restore_state(os, ot)); } catch (final Exception e) { res = false; } return res; }
public boolean save_state (OutputObjectState os, int ot) { boolean res = true; if ((targetParticipantStore != null) && (objectUid.notEquals(Uid.nullUid()))) { try { UidHelper.packInto(objectUid, os); os.packString(typeName); res = (res && super.save_state(os, ot)); } catch (IOException e) { tsLogger.i18NLogger.warn_DisposeRecord_2(); res = false; } } else { tsLogger.i18NLogger.warn_DisposeRecord_3(); res = false; } return res; }
/** * Overrides AbstractRecord.shouldMerge * * @param ar the record to potentially merge with. * * @return <code>true</code> if this instance and the parameter have the * same id (order()) and the parameter is either persistent or recoverable. * <code>false</code> otherwise. * @see com.arjuna.ats.arjuna.coordinator.RecordType */ public boolean shouldMerge (AbstractRecord ar) { return (((order().equals(ar.order())) && ((ar.typeIs() == RecordType.PERSISTENCE) || (ar.typeIs() == RecordType.RECOVERY))) ? true : false); }
oType = mergewith.typeIs(); setValue(oldState); newStateIsValid = true; oldState = new OutputObjectState((OutputObjectState)(mergewith.value()));
OutputObjectState state = null; tsLogger.i18NLogger.warn_StateManager_11(objectUid, type()); state = new OutputObjectState(objectUid, type()); tsLogger.i18NLogger.warn_StateManager_12(); record = new CadaverRecord(state, participantStore, this); tsLogger.i18NLogger.warn_StateManager_6(action.get_uid());
tsLogger.logger.trace("CadaverRecord::topLevelPrepare() for " + order()); if (targetParticipantStore.write_uncommitted(oState.stateUid(), oState.type(), oState)) if (shadowForced()) tlpOk = TwoPhaseOutcome.PREPARE_OK;
/** * At topLevelCommit we commit the uncommitted version already saved * into object participantStore. * Cannot use inherited version since that assumes object is alive * instead talk directly to the object participantStore itself. */ public int topLevelCommit () { if (tsLogger.logger.isTraceEnabled()) { tsLogger.logger.trace("CadaverRecord::topLevelCommit() for " + order()); } boolean res = true; OutputObjectState oState = super.state; if ((oState != null) && (oType == RecordType.PERSISTENCE)) { if (targetParticipantStore == null) return TwoPhaseOutcome.FINISH_ERROR; try { res = targetParticipantStore.commit_state(oState.stateUid(), oState.type()); } catch (ObjectStoreException e) { res = false; } } // super.forgetAction(false); return ((res) ? TwoPhaseOutcome.FINISH_OK : TwoPhaseOutcome.FINISH_ERROR); }
public boolean restore_state (InputObjectState os, int ot) { boolean res = true; try { objectUid = UidHelper.unpackFrom(os); typeName = os.unpackString(); res = (res && super.restore_state(os, ot)); } catch (final Exception e) { res = false; } return res; }
public boolean save_state (OutputObjectState os, int ot) { boolean res = true; if ((targetParticipantStore != null) && (objectUid.notEquals(Uid.nullUid()))) { try { UidHelper.packInto(objectUid, os); os.packString(typeName); res = (res && super.save_state(os, ot)); } catch (IOException e) { tsLogger.i18NLogger.warn_DisposeRecord_2(); res = false; } } else { tsLogger.i18NLogger.warn_DisposeRecord_3(); res = false; } return res; }
/** * Overrides AbstractRecord.shouldMerge * * @param ar the record to potentially merge with. * * @return <code>true</code> if this instance and the parameter have the * same id (order()) and the parameter is either persistent or recoverable. * <code>false</code> otherwise. * @see com.arjuna.ats.arjuna.coordinator.RecordType */ public boolean shouldMerge (AbstractRecord ar) { return (((order().equals(ar.order())) && ((ar.typeIs() == RecordType.PERSISTENCE) || (ar.typeIs() == RecordType.RECOVERY))) ? true : false); }
oType = mergewith.typeIs(); setValue(oldState); newStateIsValid = true; oldState = new OutputObjectState((OutputObjectState)(mergewith.value()));