/** * return a uid for the durable participant registered on behalf of this corodinator */ public String getDurable2PhaseId() { return PARTICIPANT_PREFIX + get_uid().stringForm() + "_D"; }
/** * return a uid for the volatile participant registered on behalf of this corodinator */ public String getVolatile2PhaseId() { return PARTICIPANT_PREFIX + get_uid().stringForm() + "_V"; }
/** * normal constructor used when the subordinate coordinator is registered as a durable participant * with its parent coordinator. * * @param coordinator */ public SubordinateDurable2PCStub(SubordinateATCoordinator coordinator) { this.coordinator = coordinator; this.coordinatorId = coordinator.get_uid().stringForm(); this.recovered = false; }
/** * normal constructor used when the subordinate coordinator is registered as a durable participant * with its parent coordinator. * * @param coordinator */ public SubordinateDurable2PCStub(SubordinateATCoordinator coordinator) { this.coordinator = coordinator; this.coordinatorId = coordinator.get_uid().stringForm(); this.recovered = false; }
protected static synchronized void removeRecoveredCoordinator(SubordinateATCoordinator coordinator) { recoveredCoordinators.remove(coordinator.get_uid().stringForm()); }
/** * normal constructor used when the subordinate coordinator is registered as a durable participant * with its parent coordinator. * * @param coordinator */ public SubordinateDurable2PCStub(SubordinateATCoordinator coordinator) { this.coordinator = coordinator; this.coordinatorId = coordinator.get_uid().stringForm(); this.recovered = false; }
/** * return a uid for the durable participant registered on behalf of this corodinator */ public String getDurable2PhaseId() { return PARTICIPANT_PREFIX + get_uid().stringForm() + "_D"; }
/** * return a uid for the volatile participant registered on behalf of this corodinator */ public String getVolatile2PhaseId() { return PARTICIPANT_PREFIX + get_uid().stringForm() + "_V"; }
protected static synchronized void addRecoveredCoordinator(SubordinateATCoordinator coordinator) { recoveredCoordinators.put(coordinator.get_uid().stringForm(), coordinator); }
protected static synchronized void removeRecoveredCoordinator(SubordinateATCoordinator coordinator) { recoveredCoordinators.remove(coordinator.get_uid().stringForm()); }
protected static synchronized void addRecoveredCoordinator(SubordinateATCoordinator coordinator) { recoveredCoordinators.put(coordinator.get_uid().stringForm(), coordinator); }
/** * test whether a transaction has been restored without its proxy participant. this indicates that * we crashed between preparing the suborindate TX and logging the proxy participant. * @return */ public boolean isOrphaned() { String id = get_uid().stringForm(); if (isActiveProxy(id)) { return false; } // the proxy may have been removed because this tx has been resolved while we were checking if (getRecoveredCoordinator(id) == null) { return false; } // ok we have a tx but no proxy so this is really an orphan return true; }
/** * test whether a transaction has been restored without its proxy participant. this indicates that * we crashed between preparing the suborindate TX and logging the proxy participant. * @return */ public boolean isOrphaned() { String id = get_uid().stringForm(); if (isActiveProxy(id)) { return false; } // the proxy may have been removed because this tx has been resolved while we were checking if (getRecoveredCoordinator(id) == null) { return false; } // ok we have a tx but no proxy so this is really an orphan return true; }
/** * look for recovered subordinate transactions which do not have an associated proxy participant * rolling back any that are found. this only needs doing once after the first participant and * subordinate transaction recovery passes have both completed */ private void cullOrphanedSubordinates() { if (culledOrphanSubordinates || !(subordinateCoordinatorRecoveryStarted && participantRecoveryStarted)) { return; } culledOrphanSubordinates = true; SubordinateATCoordinator[] coordinators = SubordinateATCoordinator.listRecoveredCoordinators(); for (SubordinateATCoordinator coordinator : coordinators) { if (coordinator.getSubordinateType().equals(SubordinateATCoordinator.SUBORDINATE_TX_TYPE_AT_AT) && coordinator.isOrphaned()) { RecoveryLogger.i18NLogger.warn_participant_at_XTSATRecoveryModule_5(coordinator.get_uid()); coordinator.rollback(); } } }
/** * look for recovered subordinate transactions which do not have an associated proxy participant * rolling back any that are found. this only needs doing once after the first participant and * subordinate transaction recovery passes have both completed */ private void cullOrphanedSubordinates() { if (culledOrphanSubordinates || !(subordinateCoordinatorRecoveryStarted && participantRecoveryStarted)) { return; } culledOrphanSubordinates = true; SubordinateATCoordinator[] coordinators = SubordinateATCoordinator.listRecoveredCoordinators(); for (SubordinateATCoordinator coordinator : coordinators) { if (coordinator.getSubordinateType().equals(SubordinateATCoordinator.SUBORDINATE_TX_TYPE_AT_AT) && coordinator.isOrphaned()) { RecoveryLogger.i18NLogger.warn_participant_at_XTSATRecoveryModule_5(coordinator.get_uid()); coordinator.rollback(); } } }
/** * look for recovered subordinate transactions which do not have an associated proxy participant * rolling back any that are found. this only needs doing once after the first participant and * subordinate transaction recovery passes have both completed */ private void cullOrphanedSubordinates() { if (culledOrphanSubordinates || !(subordinateCoordinatorRecoveryStarted && participantRecoveryStarted)) { return; } culledOrphanSubordinates = true; SubordinateATCoordinator[] coordinators = SubordinateATCoordinator.listRecoveredCoordinators(); for (SubordinateATCoordinator coordinator : coordinators) { if (coordinator.getSubordinateType().equals(SubordinateATCoordinator.SUBORDINATE_TX_TYPE_AT_AT) && coordinator.isOrphaned()) { RecoveryLogger.i18NLogger.warn_participant_at_XTSATRecoveryModule_5(coordinator.get_uid()); coordinator.rollback(); } } }
runCallback(get_uid().stringForm());
runCallback(get_uid().stringForm());
runCallback(get_uid().stringForm());
runCallback(get_uid().stringForm());