use of org.omg.CosTransactions.NotSubtransaction in project narayana by jbosstm.
the class ArjunaTransactionImple method register_subtran_aware.
/**
* Do not propagate the resource to the parent.
*/
public void register_subtran_aware(SubtransactionAwareResource r) throws Inactive, NotSubtransaction, SystemException {
if (jtsLogger.logger.isTraceEnabled()) {
jtsLogger.logger.trace("ArjunaTransactionImple::register_subtran_aware called for " + get_uid());
}
if (r == null)
throw new BAD_PARAM(0, CompletionStatus.COMPLETED_NO);
currentStatus = determineStatus(this);
if (currentStatus != Status.StatusActive) {
if (currentStatus == Status.StatusMarkedRollback) {
throw new TRANSACTION_ROLLEDBACK(ExceptionCodes.MARKED_ROLLEDBACK, CompletionStatus.COMPLETED_NO);
} else
throw new Inactive();
}
if (this == rootAction) {
if (jtsLogger.logger.isTraceEnabled()) {
jtsLogger.logger.trace("ArjunaTransactionImple::register_subtran_aware called for " + get_uid() + " : not a subtransaction!");
}
throw new NotSubtransaction();
} else {
Coordinator coord = null;
AbstractRecord corbaRec = null;
try {
coord = parentHandle.get_coordinator();
corbaRec = createOTSRecord(false, r, coord);
} catch (Unavailable ex) {
throw new UNKNOWN(ExceptionCodes.INACTIVE_TRANSACTION, // what else to raise?
CompletionStatus.COMPLETED_NO);
}
coord = null;
if (add(corbaRec) != AddOutcome.AR_ADDED) {
if (jtsLogger.logger.isTraceEnabled()) {
jtsLogger.logger.trace("ArjunaTransactionImple::register_subtran_aware called for " + get_uid() + " : could not add.");
}
corbaRec = null;
// what else to raise??
throw new Inactive();
}
}
if (jtsLogger.logger.isTraceEnabled()) {
jtsLogger.logger.trace("ArjunaTransactionImple::register_subtran_aware called for " + get_uid() + " : subtran_aware_resource registered");
}
}
Aggregations