Search in sources :

Example 76 with ObjectStoreException

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

the class TransactionRecoveryModule method periodicWorkSecondPass.

/*
     * We may have caught some transactions in flight that are
     * going to complete normally. We'll wait a short time
     * before rechecking if they are still around. If so, we
     * process them.
     */
protected void periodicWorkSecondPass() {
    jtsLogger.i18NLogger.info_recovery_transactions_TransactionRecoveryModule_12();
    // Process the Vector of transaction Uids
    Enumeration transactionUidEnum = _transactionUidVector.elements();
    while (transactionUidEnum.hasMoreElements()) {
        Uid currentUid = (Uid) transactionUidEnum.nextElement();
        try {
            // Is the intentions list still there? Is this the best way to check?
            if (_recoveryStore.currentState(currentUid, _transactionType) != StateStatus.OS_UNKNOWN) {
                jtsLogger.i18NLogger.info_recovery_transactions_TransactionRecoveryModule_6(currentUid);
                recoverTransaction(currentUid);
            } else {
                // Transaction has gone away - probably completed normally
                if (jtsLogger.logger.isDebugEnabled()) {
                    jtsLogger.logger.debug("Transaction " + currentUid + " in state unknown (?)");
                }
            }
        } catch (ObjectStoreException e4) {
            if (jtsLogger.logger.isDebugEnabled()) {
                jtsLogger.logger.debug("Transaction " + currentUid + " is not in object store - assumed completed");
            }
        }
    }
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) ObjectStoreException(com.arjuna.ats.arjuna.exceptions.ObjectStoreException) Enumeration(java.util.Enumeration)

Example 77 with ObjectStoreException

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

the class ServerTransactionRecoveryModule method periodicWorkSecondPass.

public void periodicWorkSecondPass() {
    jtsLogger.i18NLogger.info_recovery_transactions_ServerTransactionRecoveryModule_4();
    // super.periodicWorkSecondPass();
    // Process the Vector of transaction Uids
    Enumeration transactionUidEnum = _transactionUidVector.elements();
    while (transactionUidEnum.hasMoreElements()) {
        Uid currentUid = (Uid) transactionUidEnum.nextElement();
        try {
            // Is the intentions list still there? Is this the best way to check?
            if (_recoveryStore.currentState(currentUid, _transactionType) != StateStatus.OS_UNKNOWN) {
                jtsLogger.i18NLogger.info_recovery_transactions_ServerTransactionRecoveryModule_5(currentUid);
                recoverTransaction(currentUid);
            } else {
                if (jtsLogger.logger.isDebugEnabled()) {
                    jtsLogger.logger.debug("ServerTransactionRecoveryModule - Transaction " + currentUid + " still in state unknown (?).");
                }
            }
        } catch (ObjectStoreException e4) {
            if (jtsLogger.logger.isDebugEnabled()) {
                jtsLogger.logger.debug("ServerTransactionRecoveryModule - Transaction " + currentUid + " is not in object store - assumed completed");
            }
        }
    }
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) ObjectStoreException(com.arjuna.ats.arjuna.exceptions.ObjectStoreException) Enumeration(java.util.Enumeration)

Example 78 with ObjectStoreException

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

the class BACoordinatorRecoveryModule method processTransactionsStatus.

private void processTransactionsStatus() {
    // Process the Vector of transaction Uids
    Enumeration transactionUidEnum = _transactionUidVector.elements();
    while (transactionUidEnum.hasMoreElements()) {
        Uid currentUid = (Uid) transactionUidEnum.nextElement();
        try {
            if (_recoveryStore.currentState(currentUid, _transactionType) != StateStatus.OS_UNKNOWN) {
                doRecoverTransaction(currentUid);
            }
        } catch (ObjectStoreException ex) {
            RecoveryLogger.i18NLogger.warn_coordinator_ba_BACoordinatorRecoveryModule_3(currentUid, ex);
        }
    }
    XTSBARecoveryManager.getRecoveryManager().setCoordinatorRecoveryStarted();
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) ObjectStoreException(com.arjuna.ats.arjuna.exceptions.ObjectStoreException) Enumeration(java.util.Enumeration)

Example 79 with ObjectStoreException

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

the class BACoordinatorRecoveryModule method periodicWorkFirstPass.

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

Example 80 with ObjectStoreException

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

the class SubordinateBACoordinatorRecoveryModule method processTransactionsStatus.

private void processTransactionsStatus() {
    // Process the Vector of transaction Uids
    Enumeration transactionUidEnum = _transactionUidVector.elements();
    while (transactionUidEnum.hasMoreElements()) {
        Uid currentUid = (Uid) transactionUidEnum.nextElement();
        try {
            if (_recoveryStore.currentState(currentUid, _transactionType) != StateStatus.OS_UNKNOWN) {
                doRecoverTransaction(currentUid);
            }
        } catch (ObjectStoreException ex) {
            RecoveryLogger.i18NLogger.warn_coordinator_ba_SubordinateBACoordinatorRecoveryModule_3(currentUid, ex);
        }
    }
    XTSBARecoveryManager.getRecoveryManager().setSubordinateCoordinatorRecoveryStarted();
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) ObjectStoreException(com.arjuna.ats.arjuna.exceptions.ObjectStoreException) Enumeration(java.util.Enumeration)

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