Search in sources :

Example 86 with ObjectStoreException

use of com.arjuna.ats.arjuna.exceptions.ObjectStoreException 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;
}
Also used : InputObjectState(com.arjuna.ats.arjuna.state.InputObjectState) Uid(com.arjuna.ats.arjuna.common.Uid) ObjectStoreException(com.arjuna.ats.arjuna.exceptions.ObjectStoreException) SubordinateAtomicAction(com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.jca.SubordinateAtomicAction) IOException(java.io.IOException) RecoveryStore(com.arjuna.ats.arjuna.objectstore.RecoveryStore)

Example 87 with ObjectStoreException

use of com.arjuna.ats.arjuna.exceptions.ObjectStoreException 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);
    }
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) ObjectStoreException(com.arjuna.ats.arjuna.exceptions.ObjectStoreException) RecoveryStore(com.arjuna.ats.arjuna.objectstore.RecoveryStore)

Aggregations

ObjectStoreException (com.arjuna.ats.arjuna.exceptions.ObjectStoreException)87 IOException (java.io.IOException)44 Uid (com.arjuna.ats.arjuna.common.Uid)35 InputObjectState (com.arjuna.ats.arjuna.state.InputObjectState)34 OutputObjectState (com.arjuna.ats.arjuna.state.OutputObjectState)23 File (java.io.File)11 Connection (java.sql.Connection)9 PreparedStatement (java.sql.PreparedStatement)9 SQLException (java.sql.SQLException)9 NamingException (javax.naming.NamingException)9 Enumeration (java.util.Enumeration)8 RecoveryStore (com.arjuna.ats.arjuna.objectstore.RecoveryStore)6 FileNotFoundException (java.io.FileNotFoundException)5 ResultSet (java.sql.ResultSet)5 ArrayList (java.util.ArrayList)5 ParticipantStore (com.arjuna.ats.arjuna.objectstore.ParticipantStore)4 XidImple (com.arjuna.ats.jta.xa.XidImple)4 RandomAccessFile (java.io.RandomAccessFile)3 SyncFailedException (java.io.SyncFailedException)3 Statement (java.sql.Statement)3