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;
}
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;
}
Aggregations