private void doRecoverTransaction( Uid recoverUid ) { boolean commitThisTransaction = true ; // Retrieve the transaction status from its original process. int theStatus = _transactionStatusConnectionMgr.getTransactionStatus( _transactionType, recoverUid ) ; boolean inFlight = isTransactionInMidFlight( theStatus ) ; String Status = ActionStatus.stringForm( theStatus ) ; if (tsLogger.logger.isDebugEnabled()) { tsLogger.logger.debug("transaction type is " + _transactionType + " uid is " + recoverUid.toString() + "\n ActionStatus is " + Status + " in flight is " + inFlight); } if ( ! inFlight ) { try { RecoverAtomicAction rcvAtomicAction = new RecoverAtomicAction( recoverUid, theStatus ) ; rcvAtomicAction.replayPhase2() ; } catch ( Exception ex ) { tsLogger.i18NLogger.warn_recovery_AtomicActionRecoveryModule_2(recoverUid, ex); } } }
createPreparedLists(); Header hdr = new Header(); unpackHeader(os, hdr); AbstractRecord record = AbstractRecord.create(record_type); tsLogger.i18NLogger.warn_coordinator_BasicAction_21(Integer.toString(record_type)); res = (record.restore_state(os, ot) && preparedList.insert(record)); tsLogger.logger.warn("Transaction "+get_uid()+" has "+hSize+" heuristic participant(s)!"); AbstractRecord record = AbstractRecord.create(record_type); res = (record.restore_state(os, ot) && heuristicList.insert(record)); tsLogger.i18NLogger.warn_coordinator_norecordfound(Integer.toString(record_type)); tsLogger.i18NLogger.warn_coordinator_BasicAction_24(); tsLogger.logger.trace("Restored action status of "+ActionStatus.stringForm(tempActionStatus)+ " "+Integer.toString(tempActionStatus));
packHeader(os, new Header(get_uid(), Utility.getProcessUid())); if ((failedList != null) && (failedList.size() > 0)) AbstractRecord first = ((listToSave != null) ? listToSave.getFront() : null); AbstractRecord temp = first; listToSave.putRear(temp); tsLogger.logger.trace("BasicAction::save_state - next record to pack is a "+temp.typeIs() +" record "+temp.type()+" should save it? = "+temp.doSave()); tsLogger.logger.trace("Packing action status of "+ActionStatus.stringForm(actionStatus));
+ get_uid()); tsLogger.i18NLogger.warn_coordinator_notrunning(); tsLogger.i18NLogger.warn_coordinator_BasicAction_29(get_uid(), ActionStatus.stringForm(actionStatus)); actionInitialise(parentAct); actionStatus = ActionStatus.RUNNING; tsLogger.i18NLogger.warn_coordinator_BasicAction_30(get_uid());
tsLogger.logger.debug("RecoverAtomicAction.replayPhase2 recovering "+get_uid()+" ActionStatus is "+ActionStatus.stringForm(_theStatus)); (_theStatus == ActionStatus.H_HAZARD) ) super.phase2Commit( _reportHeuristics ) ; (_theStatus == ActionStatus.ABORT_ONLY) ) super.phase2Abort( _reportHeuristics ) ; tsLogger.i18NLogger.warn_recovery_RecoverAtomicAction_2(ActionStatus.stringForm(_theStatus)); tsLogger.logger.debug("RecoverAtomicAction.replayPhase2( "+get_uid()+" ) finished"); tsLogger.i18NLogger.warn_recovery_RecoverAtomicAction_4(get_uid()); tsLogger.i18NLogger.warn_recovery_RecoverAtomicAction_5(get_uid());
switch (_theTransaction.status()) break; default: throw new IllegalStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_inactive() ); jtaLogger.i18NLogger.warn_transaction_arjunacore_endsuspendfailed1(); int outcome = _theTransaction.cancel(); // use cancel of break; default: throw new IllegalStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_rollbackstatus() + ActionStatus.stringForm(outcome));
else String printableForm = "ActionStatus: "+ActionStatus.stringForm(super.status()); printableForm += "\nHeuristic Decision: "+TwoPhaseOutcome.stringForm(super.getHeuristicDecision()); if (super.preparedList.size() == 0) printableForm += "\nNo prepared entries."; else if (super.heuristicList.size() == 0) printableForm += "\nNo heuristic entries."; else
void registerSynchronizationImple(SynchronizationImple synchronizationImple) throws javax.transaction.RollbackException, java.lang.IllegalStateException, javax.transaction.SystemException { if (_theTransaction != null) { if (_theTransaction.addSynchronization(synchronizationImple) != AddOutcome.AR_ADDED) { int status = _theTransaction.status(); switch (status) { case ActionStatus.ABORT_ONLY: case ActionStatus.ABORTED: throw new javax.transaction.RollbackException( jtaLogger.i18NLogger.get_transaction_arjunacore_syncwhenaborted() ); case ActionStatus.CREATED: throw new IllegalStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_inactive(_theTransaction.get_uid()) ); default: throw new IllegalStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_syncsnotallowed() + ActionStatus.stringForm(status)); } } } else throw new IllegalStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_inactive() ); }
if (SubordinateBACoordinator.getRecoveredCoordinator(recoverUid.stringForm()) != null) { return; int theStatus = _transactionStatusConnectionMgr.getTransactionStatus( _transactionType, recoverUid ) ; String Status = ActionStatus.stringForm( theStatus ) ; recoverUid.toString() + "\n ActionStatus is " + Status + " in flight is " + inFlight);
createPreparedLists(); Header hdr = new Header(); unpackHeader(os, hdr); AbstractRecord record = AbstractRecord.create(record_type); res = (record.restore_state(os, ot) && preparedList.insert(record)); AbstractRecord record = AbstractRecord.create(record_type); res = (record.restore_state(os, ot) && heuristicList.insert(record)); { ActionStatus.stringForm(tempActionStatus), Integer.toString(tempActionStatus) });
if(_theTransaction.status() == ActionStatus.RUNNING || _theTransaction.status() == ActionStatus.ABORT_ONLY) { int outcome = _theTransaction.abort(); // assure thread disassociation, even if tx is already done. break; default: throw new InactiveTransactionException( jtaLogger.i18NLogger.get_transaction_arjunacore_rollbackstatus() + ActionStatus.stringForm(outcome)); throw new IllegalStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_inactive() );
int theStatus = _transactionStatusConnectionMgr.getTransactionStatus( _transactionType, recoverUid ) ; String Status = ActionStatus.stringForm( theStatus ) ; recoverUid.toString() + "\n ActionStatus is " + Status + " in flight is " + inFlight);
/** * Overloads Object.toString() */ public String toString () { return new String("BasicAction: " + get_uid() + " status: " + ActionStatus.stringForm(actionStatus)); }
/** * Print the status on the specified <code>PrintWriter</code>. */ public static void print (PrintWriter strm, int res) { strm.print(ActionStatus.stringForm(res)); }
createPreparedLists(); Header hdr = new Header(); unpackHeader(os, hdr); AbstractRecord record = AbstractRecord.create(record_type); tsLogger.i18NLogger.warn_coordinator_BasicAction_21(Integer.toString(record_type)); res = (record.restore_state(os, ot) && preparedList.insert(record)); tsLogger.logger.warn("Transaction "+get_uid()+" has "+hSize+" heuristic participant(s)!"); AbstractRecord record = AbstractRecord.create(record_type); res = (record.restore_state(os, ot) && heuristicList.insert(record)); tsLogger.i18NLogger.warn_coordinator_norecordfound(Integer.toString(record_type)); tsLogger.i18NLogger.warn_coordinator_BasicAction_24(); tsLogger.logger.trace("Restored action status of "+ActionStatus.stringForm(tempActionStatus)+ " "+Integer.toString(tempActionStatus));
packHeader(os, new Header(get_uid(), Utility.getProcessUid())); if ((failedList != null) && (failedList.size() > 0)) AbstractRecord first = ((listToSave != null) ? listToSave.getFront() : null); AbstractRecord temp = first; listToSave.putRear(temp); tsLogger.logger.trace("BasicAction::save_state - next record to pack is a "+temp.typeIs() +" record "+temp.type()+" should save it? = "+temp.doSave()); tsLogger.logger.trace("Packing action status of "+ActionStatus.stringForm(actionStatus));
+ get_uid()); tsLogger.i18NLogger.warn_coordinator_notrunning(); tsLogger.i18NLogger.warn_coordinator_BasicAction_29(get_uid(), ActionStatus.stringForm(actionStatus)); actionInitialise(parentAct); actionStatus = ActionStatus.RUNNING; tsLogger.i18NLogger.warn_coordinator_BasicAction_30(get_uid());
tsLogger.logger.debug("RecoverAtomicAction.replayPhase2 recovering "+get_uid()+" ActionStatus is "+ActionStatus.stringForm(_theStatus)); (_theStatus == ActionStatus.H_HAZARD) ) super.phase2Commit( _reportHeuristics ) ; (_theStatus == ActionStatus.ABORT_ONLY) ) super.phase2Abort( _reportHeuristics ) ; tsLogger.i18NLogger.warn_recovery_RecoverAtomicAction_2(ActionStatus.stringForm(_theStatus)); tsLogger.logger.debug("RecoverAtomicAction.replayPhase2( "+get_uid()+" ) finished"); tsLogger.i18NLogger.warn_recovery_RecoverAtomicAction_4(get_uid()); tsLogger.i18NLogger.warn_recovery_RecoverAtomicAction_5(get_uid());
switch (_theTransaction.status()) break; default: throw new IllegalStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_inactive(_theTransaction.get_uid()) ); jtaLogger.i18NLogger.warn_transaction_arjunacore_endsuspendfailed1(); int outcome = _theTransaction.cancel(); // use cancel of break; default: throw new IllegalStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_rollbackstatus() + ActionStatus.stringForm(outcome));
else String printableForm = "ActionStatus: "+ActionStatus.stringForm(super.status()); printableForm += "\nHeuristic Decision: "+TwoPhaseOutcome.stringForm(super.getHeuristicDecision()); if (super.preparedList.size() == 0) printableForm += "\nNo prepared entries."; else if (super.heuristicList.size() == 0) printableForm += "\nNo heuristic entries."; else