/** * Get the status of a transaction as it is in the original process * (so type is not needed) * NoTransaction means the original process has gone */ public static Status getOriginalStatus (Uid actionUid, String theType) throws SystemException { Status theStatus = Status.StatusUnknown; TransactionCacheItem cacheItem = get (actionUid, theType); if (cacheItem != null) { synchronized (cacheItem) { RecoveringTransaction theTransaction = cacheItem.freshTransaction(); if (theTransaction != null) { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug("asking the tran for original status"); } theStatus = theTransaction.getOriginalStatus(); } else { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug("no transaction in cache so not asking for original status"); } } } } return theStatus; }
/** * Get the status of a transaction */ public static Status get_status (Uid actionUid, String theType) throws SystemException { Status theStatus = Status.StatusUnknown; TransactionCacheItem cacheItem = get(actionUid, theType); if (cacheItem != null) { synchronized (cacheItem) { RecoveringTransaction theTransaction = cacheItem.freshTransaction(); if (theTransaction != null) { theStatus = theTransaction.get_status(); // remember the status in the cacheitem cacheItem.setStatus(theStatus); } } } return theStatus; }
/** * Get the status of a transaction */ public static Status get_status (Uid actionUid, String theType) throws SystemException { Status theStatus = Status.StatusUnknown; TransactionCacheItem cacheItem = get(actionUid, theType); if (cacheItem != null) { synchronized (cacheItem) { RecoveringTransaction theTransaction = cacheItem.freshTransaction(); if (theTransaction != null) { theStatus = theTransaction.get_status(); // remember the status in the cacheitem cacheItem.setStatus(theStatus); } } } return theStatus; }
/** * Add a new resource to a recovered transaction. This is * primarily to allow a new resource that has been provided * through a replay_completion to be added to the transaction and * thereby replacing the original resource that was passed in on * register_resource. */ public static void addResourceRecord (Uid actionUid, String theType, Uid rcUid, Resource r) { TransactionCacheItem cacheItem = get (actionUid, theType); if (cacheItem != null) { synchronized (cacheItem) { RecoveringTransaction theTransaction = cacheItem.freshTransaction(); if (theTransaction != null) { // As long as the transaction activated okay then try and add // the record. if (theTransaction.getRecoveryStatus() != RecoveryStatus.ACTIVATE_FAILED) { theTransaction.addResourceRecord(rcUid, r); } // with a new resource record, start counting attempts from zero cacheItem.resetAttemptCount(); } } } }
/** * Add a new resource to a recovered transaction. This is * primarily to allow a new resource that has been provided * through a replay_completion to be added to the transaction and * thereby replacing the original resource that was passed in on * register_resource. */ public static void addResourceRecord (Uid actionUid, String theType, Uid rcUid, Resource r) { TransactionCacheItem cacheItem = get (actionUid, theType); if (cacheItem != null) { synchronized (cacheItem) { RecoveringTransaction theTransaction = cacheItem.freshTransaction(); if (theTransaction != null) { // As long as the transaction activated okay then try and add // the record. if (theTransaction.getRecoveryStatus() != RecoveryStatus.ACTIVATE_FAILED) { theTransaction.addResourceRecord(rcUid, r); } // with a new resource record, start counting attempts from zero cacheItem.resetAttemptCount(); } } } }
RecoveringTransaction theTransaction = cacheItem.freshTransaction(); if (theTransaction != null)
RecoveringTransaction theTransaction = cacheItem.freshTransaction();
RecoveringTransaction theTransaction = cacheItem.freshTransaction();