use of com.arjuna.wst.UnknownTransactionException in project narayana by jbosstm.
the class UserTransactionImple method commitWithoutAck.
private final void commitWithoutAck() throws TransactionRolledBackException, UnknownTransactionException, SecurityException, SystemException, WrongStateException {
TxContextImple ctx = null;
String id = null;
try {
ctx = (TxContextImple) _ctxManager.suspend();
if (ctx == null) {
throw new WrongStateException();
}
id = ctx.identifier();
/*
* By default the completionParticipantURL won't be set for an interposed (imported)
* bridged transaction. This is fine, because you shouldn't be able to commit that
* transaction from a node in the tree, only from the root. So, we can prevent commit
* or rollback at this stage. The alternative would be to setup the completionParticipantURL
* and throw the exception from the remote coordinator side (see enlistCompletionParticipants
* for how to do this).
*
* The same applies for an interposed subordinate transaction created via beginSubordinate.
*/
final W3CEndpointReference completionCoordinator = (W3CEndpointReference) _completionCoordinators.get(id);
if (completionCoordinator == null)
throw new WrongStateException();
CompletionStub completionStub = new CompletionStub(id, completionCoordinator);
completionStub.commit();
} catch (SystemException ex) {
throw ex;
} catch (TransactionRolledBackException ex) {
throw ex;
} catch (UnknownTransactionException ex) {
throw ex;
} catch (SecurityException ex) {
throw ex;
} catch (WrongStateException ex) {
throw ex;
} catch (Exception ex) {
ex.printStackTrace();
throw new SystemException(ex.toString());
} finally {
try {
if (ctx != null)
_ctxManager.resume(ctx);
} catch (Exception ex) {
ex.printStackTrace();
}
if (id != null)
_completionCoordinators.remove(id);
}
}
use of com.arjuna.wst.UnknownTransactionException in project narayana by jbosstm.
the class UserTransactionStandaloneImple method begin.
public void begin(int timeout) throws WrongStateException, SystemException {
try {
if (_ctxManager.currentTransaction() != null)
throw new WrongStateException();
Context ctx = startTransaction(timeout, null);
_ctxManager.resume(new TxContextImple(ctx));
enlistCompletionParticipants();
} catch (InvalidCreateParametersException ex) {
tidyup();
throw new SystemException(ex.toString());
} catch (UnknownTransactionException ex) {
tidyup();
throw new SystemException(ex.toString());
} catch (SystemException ex) {
tidyup();
throw ex;
}
}
use of com.arjuna.wst.UnknownTransactionException in project narayana by jbosstm.
the class BusinessActivityTerminatorImple method cancel.
public void cancel() throws UnknownTransactionException, SystemException {
try {
if (_hier == null)
throw new UnknownTransactionException();
_coordManager.resume(_hier);
_coordManager.cancel();
} catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex) {
throw new UnknownTransactionException();
} catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex) {
throw new SystemException(ex.toString());
} catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex) {
throw new SystemException(ex.toString());
} catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex) {
throw new SystemException(ex.toString());
} catch (com.arjuna.mw.wscf.model.sagas.exceptions.CoordinatorConfirmedException ex) {
throw new SystemException(ex.toString());
} catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex) {
throw new UnknownTransactionException();
} catch (com.arjuna.mw.wsas.exceptions.SystemException ex) {
throw new SystemException();
} catch (UnknownTransactionException ex) {
throw ex;
} finally {
TerminationCoordinatorProcessor.getProcessor().deactivateParticipant(this);
}
}
use of com.arjuna.wst.UnknownTransactionException in project narayana by jbosstm.
the class BusinessActivityTerminatorImple method close.
public void close() throws TransactionRolledBackException, UnknownTransactionException, SystemException {
try {
if (_hier == null)
throw new UnknownTransactionException();
_coordManager.resume(_hier);
_coordManager.close();
} catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex) {
throw new UnknownTransactionException();
} catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex) {
throw new SystemException(ex.toString());
} catch (com.arjuna.mw.wscf.model.sagas.exceptions.CoordinatorCancelledException ex) {
wstxLogger.i18NLogger.warn_mwlabs_wst11_ba_coordinator_cancelled_activity();
throw new TransactionRolledBackException();
} catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex) {
throw new UnknownTransactionException();
} catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex) {
throw new SystemException(ex.toString());
} catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex) {
throw new SystemException(ex.toString());
} catch (com.arjuna.mw.wsas.exceptions.SystemException ex) {
throw new SystemException(ex.toString());
} catch (UnknownTransactionException ex) {
throw ex;
} finally {
TerminationCoordinatorProcessor.getProcessor().deactivateParticipant(this);
}
}
use of com.arjuna.wst.UnknownTransactionException in project narayana by jbosstm.
the class BAParticipantManagerImple method fail.
public void fail(final QName exceptionIdentifier) throws SystemException {
if (wstxLogger.logger.isTraceEnabled()) {
wstxLogger.logger.trace(getClass().getSimpleName() + ".fail. Participant id: " + _participantId + ", exceptionIdentifier: " + exceptionIdentifier);
}
try {
if (_hier == null)
throw new UnknownTransactionException();
_coordManager.resume(_hier);
// fail means faulted as far as the coordinator manager is concerned
_coordManager.participantFaulted(_participantId);
_coordManager.suspend();
} catch (final InvalidActivityException iae) {
throw new SystemException("UnknownTransactionException");
} catch (final UnknownTransactionException ute) {
throw new SystemException("UnknownTransactionException");
} catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex) {
throw new SystemException("UnknownParticipantException");
} catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex) {
throw new SystemException("UnknownTransactionException");
} catch (com.arjuna.mw.wsas.exceptions.SystemException ex) {
throw new SystemException(ex.toString());
}
}
Aggregations