use of org.omg.CORBA.UNKNOWN in project narayana by jbosstm.
the class ContextManager method createProxy.
public final ControlWrapper createProxy(org.omg.CORBA.Any ctx) throws SystemException {
String stringRef = null;
try {
stringRef = ctx.extract_string();
if (stringRef.startsWith(IORTag)) {
org.omg.CORBA.Object obj = ORBManager.getORB().orb().string_to_object(stringRef);
Coordinator theCoordinator = org.omg.CosTransactions.CoordinatorHelper.narrow(obj);
if (theCoordinator == null)
throw new BAD_PARAM();
return new ControlWrapper(TransactionFactoryImple.createProxy(theCoordinator, null));
} else
return null;
} catch (BAD_PARAM e1) {
jtsLogger.i18NLogger.warn_context_genfail("ContextManager " + stringRef, e1);
} catch (Exception e2) {
jtsLogger.i18NLogger.warn_context_genfail("ContextManager", e2);
throw new UNKNOWN(e2.toString());
}
return null;
}
use of org.omg.CORBA.UNKNOWN in project narayana by jbosstm.
the class TransactionFactoryImple method getTransactionInfo.
/**
* @return information on a specific transaction.
* @since JTS 2.1.2.
*/
public TransactionInfo getTransactionInfo(Uid u) throws org.omg.CosTransactions.NoTransaction, SystemException {
if (!u.valid())
throw new BAD_PARAM(jtsLogger.i18NLogger.get_orbspecific_invaliduid() + " " + u);
else {
try {
synchronized (ControlImple.allControls) {
ControlImple ctx = (ControlImple) ControlImple.allControls.get(u);
if (ctx != null) {
TransactionInfo info = new TransactionInfo();
info.currentDepth = ctx.getImplHandle().getHierarchy().depth();
TransactionReaper reaper = TransactionReaper.transactionReaper();
info.timeout = reaper.getTimeout(ctx);
info.numberOfThreads = ctx.getImplHandle().activeThreads();
return info;
} else
throw new NoTransaction();
}
} catch (NoTransaction ex) {
throw ex;
} catch (Exception e) {
e.printStackTrace();
throw new UNKNOWN();
}
}
}
use of org.omg.CORBA.UNKNOWN in project narayana by jbosstm.
the class ServerNestedAction method rollback_subtransaction.
public void rollback_subtransaction() throws SystemException {
if (jtsLogger.logger.isTraceEnabled()) {
jtsLogger.logger.trace("ServerNestedAction::rollback_subtransaction : " + _theUid);
}
if (_theControl == null) {
jtsLogger.i18NLogger.warn_orbspecific_interposition_resources_arjuna_nullcontrol_2("ServerNestedAction.rollback_subtransaction");
throw new INVALID_TRANSACTION(ExceptionCodes.SERVERAA_NO_CONTROL, CompletionStatus.COMPLETED_NO);
}
if (_theControl.isWrapper()) {
destroyResource();
return;
}
ServerTransaction theTransaction = (ServerTransaction) _theControl.getImplHandle();
try {
if (!valid())
theTransaction.doPhase2Abort();
else
theTransaction.rollback();
} catch (SystemException e) {
throw e;
} catch (Exception ex) {
throw new UNKNOWN(ex.toString());
} finally {
ThreadActionData.popAction();
destroyResource();
}
}
use of org.omg.CORBA.UNKNOWN in project narayana by jbosstm.
the class ServerNestedAction method commit_subtransaction.
public void commit_subtransaction(Coordinator parent) throws SystemException {
if (jtsLogger.logger.isTraceEnabled()) {
jtsLogger.logger.trace("ServerNestedAction::commit_subtransaction : " + _theUid);
}
if (_theControl == null) {
jtsLogger.i18NLogger.warn_orbspecific_interposition_resources_arjuna_nullcontrol_1("ServerNestedAction.commit_subtransaction");
throw new INVALID_TRANSACTION(ExceptionCodes.SERVERAA_NO_CONTROL, CompletionStatus.COMPLETED_NO);
}
if (_theControl.isWrapper()) {
destroyResource();
return;
}
ServerTransaction theTransaction = (ServerTransaction) _theControl.getImplHandle();
try {
theTransaction.commit(false);
} catch (TRANSACTION_ROLLEDBACK e1) {
jtsLogger.i18NLogger.warn_orbspecific_interposition_resources_arjuna_generror_2("ServerNestedAction.commit_subtransaction", e1);
throw e1;
} catch (INVALID_TRANSACTION e5) {
jtsLogger.i18NLogger.warn_orbspecific_interposition_resources_arjuna_generror_2("ServerNestedAction.commit_subtransaction", e5);
throw e5;
} catch (HeuristicMixed e2) {
jtsLogger.i18NLogger.warn_orbspecific_interposition_resources_arjuna_generror_2("ServerNestedAction.commit_subtransaction", e2);
throw new BAD_OPERATION(ExceptionCodes.HEURISTIC_COMMIT, CompletionStatus.COMPLETED_MAYBE);
} catch (HeuristicHazard e3) {
jtsLogger.i18NLogger.warn_orbspecific_interposition_resources_arjuna_generror_2("ServerNestedAction.commit_subtransaction", e3);
throw new BAD_OPERATION(ExceptionCodes.HEURISTIC_COMMIT, CompletionStatus.COMPLETED_MAYBE);
} catch (SystemException e4) {
jtsLogger.i18NLogger.warn_orbspecific_interposition_resources_arjuna_generror_2("ServerNestedAction.commit_subtransaction", e4);
throw e4;
} catch (Exception e5) {
jtsLogger.i18NLogger.warn_orbspecific_interposition_resources_arjuna_generror_2("ServerNestedAction.commit_subtransaction", e5);
throw new UNKNOWN(e5.toString());
} finally {
ThreadActionData.popAction();
destroyResource();
}
}
use of org.omg.CORBA.UNKNOWN in project narayana by jbosstm.
the class ServerTopLevelAction method commit_one_phase.
public void commit_one_phase() throws HeuristicHazard, SystemException {
if (jtsLogger.logger.isTraceEnabled()) {
jtsLogger.logger.trace("ServerTopLevelAction::commit_one_phase for " + _theUid);
}
if (_theControl == null) {
throw new INVALID_TRANSACTION(ExceptionCodes.SERVERAA_NO_CONTROL, CompletionStatus.COMPLETED_NO);
}
if (_theControl.isWrapper()) {
destroyResource();
return;
}
ServerTransaction theTransaction = (ServerTransaction) _theControl.getImplHandle();
if (theTransaction == null) {
jtsLogger.i18NLogger.warn_orbspecific_interposition_resources_arjuna_notx("ServerTopLevelAction.commit_one_phase");
throw new INVALID_TRANSACTION(ExceptionCodes.NO_TRANSACTION, CompletionStatus.COMPLETED_NO);
}
// LockManager needs to know if there is a transaction
ThreadActionData.pushAction(theTransaction);
try {
/*
* This will commit and do any before/after_completion calls
* on registered synchronizations.
*/
theTransaction.doCommit(true);
} catch (HeuristicHazard e1) {
/*
* Is a heuristic, then don't remove the
* transaction information.
*/
ThreadActionData.popAction();
throw e1;
} catch (TRANSACTION_ROLLEDBACK e4) {
ThreadActionData.popAction();
throw e4;
} catch (INVALID_TRANSACTION e5) {
ThreadActionData.popAction();
throw e5;
} catch (SystemException e6) {
ThreadActionData.popAction();
throw e6;
} catch (Exception e7) {
ThreadActionData.popAction();
throw new UNKNOWN(e7.toString());
} finally {
destroyResource();
}
ThreadActionData.popAction();
destroyResource();
}
Aggregations