/** * Can only be called after the first phase has executed * * @param xid * @return */ public synchronized boolean wasCommitted(String jndiName, Xid xid) throws ObjectStoreException { if (!queriedResourceManagers.contains(jndiName) || committedXidsToJndiNames.get(xid) == null) { periodicWorkFirstPass(); } if (!queriedResourceManagers.contains(jndiName)) { throw new ObjectStoreException(jndiName + " was not online"); } String committed = committedXidsToJndiNames.get(xid); if (tsLogger.logger.isTraceEnabled()) { tsLogger.logger.trace("wasCommitted" + xid + " " + committed); } return committed != null; }
preparedAtomicActions.addAll(convertToList(aa_uids)); preparedAtomicActions.addAll(convertToList(aa_uids)); delete(jndiName, toDelete);
@Override public void afterCompletion(int status) { if (!onePhase && status == Status.STATUS_COMMITTED) { commitMarkableResourceRecoveryModule .notifyOfCompletedBranch( commitMarkableJndiName, xid); } } });
delete(e.getKey(), e.getValue()); moveRecord(currentUid, CONNECTABLE_ATOMIC_ACTION_TYPE, ATOMIC_ACTION_TYPE); moveRecord(currentUid, CONNECTABLE_ATOMIC_ACTION_TYPE, ATOMIC_ACTION_TYPE); if (!isTransactionInMidFlight(transactionStatusConnectionMgr .getTransactionStatus(ATOMIC_ACTION_TYPE, currentUid))) { moveRecord(currentUid, ATOMIC_ACTION_TYPE, CONNECTABLE_ATOMIC_ACTION_TYPE); } else { moveRecord(currentUid, ATOMIC_ACTION_TYPE, CONNECTABLE_ATOMIC_ACTION_TYPE);
recoveryModule.periodicWorkFirstPass(); recoveryModule.periodicWorkSecondPass(); assertFalse(recoveryModule.wasCommitted("commitmarkableresource", committed));
recoveryModule = new CommitMarkableResourceRecordRecoveryModule(); recoveryModule.periodicWorkFirstPass(); assertTrue(recoveryModule.wasCommitted("commitmarkableresource", committed)); recoveryModule.periodicWorkSecondPass(); assertFalse(recoveryModule.wasCommitted("commitmarkableresource", committed));
committed = commitMarkableResourceRecoveryModule.wasCommitted(commitMarkableJndiName, xid);
crrrm.periodicWorkFirstPass(); crrrm.periodicWorkSecondPass(); long endTime = System.currentTimeMillis();
delete(e.getKey(), e.getValue()); moveRecord(currentUid, CONNECTABLE_ATOMIC_ACTION_TYPE, ATOMIC_ACTION_TYPE); moveRecord(currentUid, CONNECTABLE_ATOMIC_ACTION_TYPE, ATOMIC_ACTION_TYPE); if (!isTransactionInMidFlight(transactionStatusConnectionMgr .getTransactionStatus(ATOMIC_ACTION_TYPE, currentUid))) { moveRecord(currentUid, ATOMIC_ACTION_TYPE, CONNECTABLE_ATOMIC_ACTION_TYPE); } else { moveRecord(currentUid, ATOMIC_ACTION_TYPE, CONNECTABLE_ATOMIC_ACTION_TYPE);
commitMarkableResourceRecoveryModule.periodicWorkFirstPass(); assertTrue(commitMarkableResourceRecoveryModule.wasCommitted( "commitmarkableresource", committed)); commitMarkableResourceRecoveryModule.periodicWorkSecondPass(); assertTrue(commitMarkableResourceRecoveryModule.wasCommitted( "commitmarkableresource", committed)); manager.scan(); commitMarkableResourceRecoveryModule.periodicWorkFirstPass(); commitMarkableResourceRecoveryModule.periodicWorkSecondPass(); assertFalse(commitMarkableResourceRecoveryModule.wasCommitted( "commitmarkableresource", committed));
committed = commitMarkableResourceRecoveryModule.wasCommitted(commitMarkableJndiName, xid);
recoveryDataSource); long startTime = System.currentTimeMillis(); crrrm.periodicWorkFirstPass(); crrrm.periodicWorkSecondPass(); long endTime = System.currentTimeMillis();
delete(e.getKey(), e.getValue()); moveRecord(currentUid, CONNECTABLE_ATOMIC_ACTION_TYPE, ATOMIC_ACTION_TYPE); moveRecord(currentUid, CONNECTABLE_ATOMIC_ACTION_TYPE, ATOMIC_ACTION_TYPE); if (!isTransactionInMidFlight(transactionStatusConnectionMgr .getTransactionStatus(ATOMIC_ACTION_TYPE, currentUid))) { moveRecord(currentUid, ATOMIC_ACTION_TYPE, CONNECTABLE_ATOMIC_ACTION_TYPE); } else { moveRecord(currentUid, ATOMIC_ACTION_TYPE, CONNECTABLE_ATOMIC_ACTION_TYPE);
recoveryModule.periodicWorkFirstPass(); assertTrue(recoveryModule.wasCommitted("commitmarkableresource", committed)); recoveryModule.periodicWorkSecondPass(); assertTrue(recoveryModule.wasCommitted("commitmarkableresource", committed)); recoveryModule.periodicWorkFirstPass(); recoveryModule.periodicWorkSecondPass(); assertFalse(recoveryModule.wasCommitted("commitmarkableresource", committed));
preparedAtomicActions.addAll(convertToList(aa_uids)); preparedAtomicActions.addAll(convertToList(aa_uids)); delete(jndiName, toDelete);
committed = commitMarkableResourceRecoveryModule.wasCommitted(commitMarkableJndiName, xid);
/** * Can only be called after the first phase has executed * * @param xid * @throws ObjectStoreException if the resource manager was offline * @return whether the Xid was commited by the resource manager */ public synchronized boolean wasCommitted(String jndiName, Xid xid) throws ObjectStoreException { if (!queriedResourceManagers.contains(jndiName) || committedXidsToJndiNames.get(xid) == null) { periodicWorkFirstPass(); } if (!queriedResourceManagers.contains(jndiName)) { throw new ObjectStoreException(jndiName + " was not online"); } String committed = committedXidsToJndiNames.get(xid); if (tsLogger.logger.isTraceEnabled()) { tsLogger.logger.trace("wasCommitted" + xid + " " + committed); } return committed != null; }
@Override public void afterCompletion(int status) { if (!onePhase && status == Status.STATUS_COMMITTED) { commitMarkableResourceRecoveryModule .notifyOfCompletedBranch( commitMarkableJndiName, xid); } } });
delete(e.getKey(), e.getValue()); moveRecord(currentUid, CONNECTABLE_ATOMIC_ACTION_TYPE, ATOMIC_ACTION_TYPE); moveRecord(currentUid, CONNECTABLE_ATOMIC_ACTION_TYPE, ATOMIC_ACTION_TYPE); if (!isTransactionInMidFlight(transactionStatusConnectionMgr .getTransactionStatus(ATOMIC_ACTION_TYPE, currentUid))) { moveRecord(currentUid, ATOMIC_ACTION_TYPE, CONNECTABLE_ATOMIC_ACTION_TYPE); } else { moveRecord(currentUid, ATOMIC_ACTION_TYPE, CONNECTABLE_ATOMIC_ACTION_TYPE);
recoveryModule.periodicWorkFirstPass(); recoveryModule.periodicWorkSecondPass(); assertTrue(recoveryModule.wasCommitted("commitmarkableresource", committed)); assertTrue(recoveryModule.wasCommitted("commitmarkableresource", committed)); recoveryModule.periodicWorkFirstPass(); assertTrue(recoveryModule.wasCommitted("commitmarkableresource", committed)); recoveryModule.periodicWorkSecondPass(); assertFalse(recoveryModule.wasCommitted("commitmarkableresource", committed));