Search in sources :

Example 26 with ObjectStoreException

use of com.arjuna.ats.arjuna.exceptions.ObjectStoreException in project narayana by jbosstm.

the class ExceptionsUnitTest method test.

@Test
public void test() {
    FatalError fe = new FatalError();
    fe = new FatalError("problem");
    fe = new FatalError("problem", new NullPointerException());
    fe = new FatalError(new NullPointerException());
    ObjectStoreError os = new ObjectStoreError();
    os = new ObjectStoreError("problem");
    os = new ObjectStoreError("problem", new NullPointerException());
    os = new ObjectStoreError(new NullPointerException());
    ObjectStoreException ox = new ObjectStoreException();
    ox = new ObjectStoreException("problem");
    ox = new ObjectStoreException("problem", new NullPointerException());
    ox = new ObjectStoreException(new NullPointerException());
}
Also used : FatalError(com.arjuna.ats.arjuna.exceptions.FatalError) ObjectStoreException(com.arjuna.ats.arjuna.exceptions.ObjectStoreException) ObjectStoreError(com.arjuna.ats.arjuna.exceptions.ObjectStoreError) Test(org.junit.Test)

Example 27 with ObjectStoreException

use of com.arjuna.ats.arjuna.exceptions.ObjectStoreException in project narayana by jbosstm.

the class TransactionImple method createXid.

@Override
protected Xid createXid(boolean branch, XAModifier theModifier, XAResource xaResource) throws IOException, ObjectStoreException {
    Xid xid = baseXid();
    // We can have subordinate XIDs that can be editted
    if (xid.getFormatId() != XATxConverter.FORMAT_ID)
        return xid;
    Integer eisName = null;
    if (branch) {
        if (_xaResourceRecordWrappingPlugin != null) {
            eisName = _xaResourceRecordWrappingPlugin.getEISName(xaResource);
        }
    }
    xid = new XidImple(xid, branch, eisName);
    if (theModifier != null) {
        try {
            xid = theModifier.createXid((XidImple) xid);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    return xid;
}
Also used : XidImple(com.arjuna.ats.jta.xa.XidImple) Xid(javax.transaction.xa.Xid) InvalidTerminationStateException(com.arjuna.ats.jta.exceptions.InvalidTerminationStateException) HeuristicRollbackException(javax.transaction.HeuristicRollbackException) UnexpectedConditionException(com.arjuna.ats.jta.exceptions.UnexpectedConditionException) IOException(java.io.IOException) ObjectStoreException(com.arjuna.ats.arjuna.exceptions.ObjectStoreException) SystemException(javax.transaction.SystemException) RollbackException(javax.transaction.RollbackException) HeuristicMixedException(javax.transaction.HeuristicMixedException) HeuristicCommitException(javax.transaction.HeuristicCommitException)

Example 28 with ObjectStoreException

use of com.arjuna.ats.arjuna.exceptions.ObjectStoreException in project narayana by jbosstm.

the class SubordinateBACoordinatorRecoveryModule method periodicWorkFirstPass.

/**
 * This is called periodically by the RecoveryManager
 */
public void periodicWorkFirstPass() {
    // Transaction type
    boolean SubordinateCoordinators = false;
    // uids per transaction type
    InputObjectState acc_uids = new InputObjectState();
    try {
        if (RecoveryLogger.logger.isDebugEnabled()) {
            RecoveryLogger.logger.debug("StatusModule: first pass ");
        }
        SubordinateCoordinators = _recoveryStore.allObjUids(_transactionType, acc_uids);
    } catch (ObjectStoreException ex) {
        RecoveryLogger.i18NLogger.warn_coordinator_ba_SubordinateCoordinatorRecoveryModule_1(ex);
    }
    if (SubordinateCoordinators) {
        _transactionUidVector = processTransactions(acc_uids);
    }
}
Also used : InputObjectState(com.arjuna.ats.arjuna.state.InputObjectState) ObjectStoreException(com.arjuna.ats.arjuna.exceptions.ObjectStoreException)

Example 29 with ObjectStoreException

use of com.arjuna.ats.arjuna.exceptions.ObjectStoreException in project narayana by jbosstm.

the class ATParticipantRecoveryModule method periodicWorkFirstPass.

/**
 * This is called periodically by the RecoveryManager
 */
public void periodicWorkFirstPass() {
    // Transaction type
    boolean ATParticipants = false;
    // uids per transaction type
    InputObjectState acc_uids = new InputObjectState();
    try {
        if (RecoveryLogger.logger.isDebugEnabled()) {
            RecoveryLogger.logger.debug("ATParticipantRecoveryModule: first pass");
        }
        ATParticipants = _recoveryStore.allObjUids(_participantType, acc_uids);
    } catch (ObjectStoreException ex) {
        RecoveryLogger.i18NLogger.warn_participant_at_ATParticipantRecoveryModule_1(ex);
    }
    if (ATParticipants) {
        _participantUidVector = processParticipants(acc_uids);
    }
}
Also used : InputObjectState(com.arjuna.ats.arjuna.state.InputObjectState) ObjectStoreException(com.arjuna.ats.arjuna.exceptions.ObjectStoreException)

Example 30 with ObjectStoreException

use of com.arjuna.ats.arjuna.exceptions.ObjectStoreException in project narayana by jbosstm.

the class XTSBARecoveryManagerImple method deleteParticipantRecoveryRecord.

/**
 * remove any participant recovery record with the supplied id from persistent storage
 * @param id the id of the participant whose recovery details are being deleted
 */
public boolean deleteParticipantRecoveryRecord(String id) {
    Uid uid = uidMap.get(id);
    if (uid != null) {
        try {
            txLog.remove_committed(uid, type);
            uidMap.remove(id);
            return true;
        } catch (ObjectStoreException ose) {
            RecoveryLogger.i18NLogger.warn_participant_ba_XTSBARecoveryModule_2(uid, id, ose);
        }
    }
    return false;
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) ObjectStoreException(com.arjuna.ats.arjuna.exceptions.ObjectStoreException)

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