use of com.arjuna.ats.arjuna.objectstore.RecoveryStore in project narayana by jbosstm.
the class JCAServerTransactionRecoveryModule method periodicWorkFirstPass.
@Override
public void periodicWorkFirstPass() {
try {
RecoveryStore recoveryStore = StoreManager.getRecoveryStore();
InputObjectState states = new InputObjectState();
if (recoveryStore.allObjUids(ServerTransaction.getType(), states) && (states.notempty())) {
boolean finished = false;
do {
Uid uid = UidHelper.unpackFrom(states);
if (uid.notEquals(Uid.nullUid())) {
SubordinationManager.getTransactionImporter().recoverTransaction(uid);
} else {
finished = true;
}
} while (!finished);
}
} catch (ObjectStoreException | XAException | IOException e) {
e.printStackTrace();
}
}
use of com.arjuna.ats.arjuna.objectstore.RecoveryStore in project narayana by jbosstm.
the class Coordinator method getUids.
// Look up all log records for a given type
private static Set<Uid> getUids(Set<Uid> uids, String type) {
try {
RecoveryStore recoveryStore = StoreManager.getRecoveryStore();
InputObjectState states = new InputObjectState();
if (recoveryStore.allObjUids(type, states) && states.notempty()) {
boolean finished = false;
do {
Uid uid = UidHelper.unpackFrom(states);
if (uid.notEquals(Uid.nullUid())) {
uids.add(uid);
} else {
finished = true;
}
} while (!finished);
}
} catch (Exception e) {
e.printStackTrace();
}
return uids;
}
use of com.arjuna.ats.arjuna.objectstore.RecoveryStore in project narayana by jbosstm.
the class InboundBridgeOrphanFilter method isInStore.
private boolean isInStore(Xid xid) {
final RecoveryStore recoveryStore = StoreManager.getRecoveryStore();
final InputObjectState states = new InputObjectState();
try {
if (recoveryStore.allObjUids(SubordinateAtomicAction.getType(), states) && states.notempty()) {
boolean finished = false;
do {
final Uid uid = UidHelper.unpackFrom(states);
if (uid.notEquals(Uid.nullUid())) {
final SubordinateAtomicAction saa = new SubordinateAtomicAction(uid, true);
if (saa.getXid().equals(xid)) {
return true;
}
} else {
finished = true;
}
} while (!finished);
}
} catch (ObjectStoreException e) {
LOG.warn(e.getMessage(), e);
} catch (IOException e) {
LOG.warn(e.getMessage(), e);
}
return false;
}
use of com.arjuna.ats.arjuna.objectstore.RecoveryStore in project narayana by jbosstm.
the class RecoveryManager method removeParticipantInformation.
public void removeParticipantInformation(final ParticipantInformation participantInformation) {
if (LOG.isTraceEnabled()) {
LOG.trace("RecoveryManager.removeParticipantInformation: participantInformation=" + participantInformation);
}
final RecoveryStore recoveryStore = StoreManager.getRecoveryStore();
final Uid uid = new Uid(participantInformation.getId());
try {
recoveryStore.remove_committed(uid, PARTICIPANT_INFORMATION_RECORD_TYPE);
} catch (ObjectStoreException e) {
LOG.warn("Failure while removing participant information from the object store.", e);
}
}
Aggregations