use of com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.jca.SubordinateAtomicAction in project narayana by jbosstm.
the class SubordinateTxUnitTest method testAtomicAction.
@Test
public void testAtomicAction() throws Exception {
SubordinateAtomicAction saa1 = new SubordinateAtomicAction();
SubordinateAtomicAction saa2 = new SubordinateAtomicAction(new Uid());
OutputObjectState os = new OutputObjectState();
assertTrue(saa1.save_state(os, ObjectType.ANDPERSISTENT));
InputObjectState is = new InputObjectState(os);
assertTrue(saa2.restore_state(is, ObjectType.ANDPERSISTENT));
}
use of com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.jca.SubordinateAtomicAction 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;
}
Aggregations