Search in sources :

Example 1 with ServerRecoveryTopLevelAction

use of com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerRecoveryTopLevelAction in project narayana by jbosstm.

the class RecoveredServerTransaction method getStatusFromParent.

private Status getStatusFromParent() {
    Status theStatus = Status.StatusUnknown;
    // This variable is applied with Orbix
    int not_exist_count;
    if ((super._recoveryCoordinator != null) && (get_status() == Status.StatusPrepared)) {
        ServerControl sc = new ServerControl((ServerTransaction) this);
        ServerRecoveryTopLevelAction tla = new ServerRecoveryTopLevelAction(sc);
        if (tla.valid()) {
            try {
                theStatus = super._recoveryCoordinator.replay_completion(tla.getReference());
                if (jtsLogger.logger.isDebugEnabled()) {
                    jtsLogger.logger.debug("RecoveredServerTransaction.getStatusFromParent - replay_completion status = " + Utility.stringStatus(theStatus));
                }
            } catch (TRANSIENT ex_trans) {
                /*
                     * A failure that might not occur again if the request is retried. Not definite.
                     */
                jtsLogger.i18NLogger.warn_recovery_transactions_RecoveredServerTransaction_10(get_uid());
                theStatus = Status.StatusUnknown;
            }// What here what should be done for Orbix2000
             catch (OBJECT_NOT_EXIST ex) {
                // i believe this state should be notran - ots explicitly
                // objnotexist is
                // rollback
                theStatus = Status.StatusRolledBack;
                if (jtsLogger.logger.isDebugEnabled()) {
                    jtsLogger.logger.debug("RecoveredServerTransaction.getStatusFromParent -" + " replay_completion got object_not_exist = " + Utility.stringStatus(theStatus));
                }
            } catch (NotPrepared ex1) {
                jtsLogger.i18NLogger.warn_recovery_transactions_RecoveredServerTransaction_12();
                theStatus = Status.StatusActive;
            } catch (Exception e) {
                // Unknown error, so better to do nothing at this stage.
                jtsLogger.i18NLogger.warn_recovery_transactions_RecoveredServerTransaction_13(e);
            }
        } else {
            jtsLogger.i18NLogger.warn_recovery_transactions_RecoveredServerTransaction_14(get_uid());
        }
        // Make sure we "delete" these objects when we are finished
        // with them or there will be a memory leak. If they are deleted
        // "early", and the root coordinator needs them then it will find
        // them unavailable, and will have to retry recovery later.
        sc = null;
        tla = null;
    } else {
        if (jtsLogger.logger.isDebugEnabled()) {
            jtsLogger.logger.debug("RecoveredServerTransaction:getStatusFromParent - " + "no recovcoord or status not prepared");
        }
    }
    return theStatus;
}
Also used : Status(org.omg.CosTransactions.Status) StateStatus(com.arjuna.ats.arjuna.objectstore.StateStatus) RecoveryStatus(com.arjuna.ats.internal.jts.recovery.transactions.RecoveryStatus) ServerControl(com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl) OBJECT_NOT_EXIST(org.omg.CORBA.OBJECT_NOT_EXIST) ServerRecoveryTopLevelAction(com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerRecoveryTopLevelAction) TRANSIENT(org.omg.CORBA.TRANSIENT) NotPrepared(org.omg.CosTransactions.NotPrepared) SystemException(org.omg.CORBA.SystemException) IOException(java.io.IOException) ObjectStoreException(com.arjuna.ats.arjuna.exceptions.ObjectStoreException)

Example 2 with ServerRecoveryTopLevelAction

use of com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerRecoveryTopLevelAction in project narayana by jbosstm.

the class RecoveredServerTransaction method getStatusFromParent.

private Status getStatusFromParent() {
    org.omg.CosTransactions.Status theStatus = org.omg.CosTransactions.Status.StatusUnknown;
    // This variable is applied with Orbix
    int not_exist_count;
    if ((super._recoveryCoordinator != null) && (get_status() == org.omg.CosTransactions.Status.StatusPrepared)) {
        ServerControl sc = new ServerControl((ServerTransaction) this);
        ServerRecoveryTopLevelAction tla = new ServerRecoveryTopLevelAction(sc);
        if (tla.valid()) {
            try {
                theStatus = super._recoveryCoordinator.replay_completion(tla.getReference());
                if (jtsLogger.logger.isDebugEnabled()) {
                    jtsLogger.logger.debug("RecoveredServerTransaction.getStatusFromParent - replay_completion status = " + Utility.stringStatus(theStatus));
                }
            } catch (TRANSIENT ex_trans) {
                /*
                     * A failure that might not occur again if the request is retried. Not definite.
                     */
                jtsLogger.i18NLogger.warn_recovery_transactions_RecoveredServerTransaction_10(get_uid());
                theStatus = Status.StatusUnknown;
            }// What here what should be done for Orbix2000
             catch (OBJECT_NOT_EXIST ex) {
                // i believe this state should be notran - ots explicitly
                // objnotexist is
                // rollback
                theStatus = org.omg.CosTransactions.Status.StatusRolledBack;
                if (jtsLogger.logger.isDebugEnabled()) {
                    jtsLogger.logger.debug("RecoveredServerTransaction.getStatusFromParent -" + " replay_completion got object_not_exist = " + Utility.stringStatus(theStatus));
                }
            } catch (NotPrepared ex1) {
                jtsLogger.i18NLogger.warn_recovery_transactions_RecoveredServerTransaction_12();
                theStatus = Status.StatusActive;
            } catch (Exception e) {
                // Unknown error, so better to do nothing at this stage.
                jtsLogger.i18NLogger.warn_recovery_transactions_RecoveredServerTransaction_13(e);
            }
        } else {
            jtsLogger.i18NLogger.warn_recovery_transactions_RecoveredServerTransaction_14(get_uid());
        }
        // Make sure we "delete" these objects when we are finished
        // with them or there will be a memory leak. If they are deleted
        // "early", and the root coordinator needs them then it will find
        // them unavailable, and will have to retry recovery later.
        sc = null;
        tla = null;
    } else {
        if (jtsLogger.logger.isDebugEnabled()) {
            jtsLogger.logger.debug("RecoveredServerTransaction:getStatusFromParent - " + "no recovcoord or status not prepared");
        }
    }
    return theStatus;
}
Also used : ServerControl(com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl) OBJECT_NOT_EXIST(org.omg.CORBA.OBJECT_NOT_EXIST) Status(org.omg.CosTransactions.Status) ServerRecoveryTopLevelAction(com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerRecoveryTopLevelAction) TRANSIENT(org.omg.CORBA.TRANSIENT) NotPrepared(org.omg.CosTransactions.NotPrepared) SystemException(org.omg.CORBA.SystemException) IOException(java.io.IOException) ObjectStoreException(com.arjuna.ats.arjuna.exceptions.ObjectStoreException)

Aggregations

ObjectStoreException (com.arjuna.ats.arjuna.exceptions.ObjectStoreException)2 ServerControl (com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl)2 ServerRecoveryTopLevelAction (com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerRecoveryTopLevelAction)2 IOException (java.io.IOException)2 OBJECT_NOT_EXIST (org.omg.CORBA.OBJECT_NOT_EXIST)2 SystemException (org.omg.CORBA.SystemException)2 TRANSIENT (org.omg.CORBA.TRANSIENT)2 NotPrepared (org.omg.CosTransactions.NotPrepared)2 Status (org.omg.CosTransactions.Status)2 StateStatus (com.arjuna.ats.arjuna.objectstore.StateStatus)1 RecoveryStatus (com.arjuna.ats.internal.jts.recovery.transactions.RecoveryStatus)1