/** * 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(); } } } }