use of com.arjuna.wst.UnknownTransactionException in project narayana by jbosstm.
the class TestATServiceImpl method doNothing.
@WebMethod
public void doNothing() {
try {
TransactionManager transactionManager = TransactionManagerFactory.transactionManager();
transactionManager.enlistForDurableTwoPhase(new TestATServiceParticipant(), "testServiceAT:" + UUID.randomUUID());
} catch (UnknownTransactionException e) {
// Ignore if no transaction
} catch (Exception e) {
throw new RuntimeException(e);
}
}
use of com.arjuna.wst.UnknownTransactionException in project narayana by jbosstm.
the class BridgeXAResource method readObject.
/**
* Deserialization hook. Unpacks transaction recovery information and uses it to
* recover the subordinate transaction.
*
* @param in the stream from which to unpack the object state.
* @throws IOException if deserialzation and recovery fail.
* @throws ClassNotFoundException if deserialzation fails.
*/
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
txbridgeLogger.logger.trace("BridgeXAResource.readObject()");
// in.defaultReadObject();
externalTxId = (Uid) in.readObject();
bridgeWrapperId = (String) in.readObject();
// this readObject method executes only when a log is being read at recovery time:
isAwaitingRecovery = true;
synchronized (xaResourcesAwaitingRecovery) {
xaResourcesAwaitingRecovery.add(this);
}
try {
bridgeWrapper = BridgeWrapper.recover(bridgeWrapperId);
// rollback and commit will deal with bridgeWrapper == null cases via ensureRecoveryIsDoneIfNeeded
} catch (UnknownTransactionException unknownTransactionException) {
txbridgeLogger.i18NLogger.error_obxar_unabletorecover(bridgeWrapperId, unknownTransactionException);
throw new IOException(unknownTransactionException);
}
}
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());
}
}
use of com.arjuna.wst.UnknownTransactionException in project narayana by jbosstm.
the class UserBusinessActivityStandaloneImple method complete.
public void complete() throws UnknownTransactionException, SystemException, WrongStateException {
try {
final TxContextImple ctx = ((TxContextImple) _ctxManager.currentTransaction());
if (ctx == null) {
throw new WrongStateException();
}
final String id = ctx.identifier();
final W3CEndpointReference terminatorCoordinatorRPC = getTerminationCoordinatorRPC(ctx);
BusinessActivityTerminatorRPCStub terminatorRPCStub = new BusinessActivityTerminatorRPCStub(id, terminatorCoordinatorRPC);
terminatorRPCStub.complete();
} catch (SystemException ex) {
throw ex;
} catch (UnknownTransactionException ex) {
throw ex;
} catch (WrongStateException ex) {
throw ex;
} catch (Exception ex) {
throw new SystemException(ex.toString());
}
}
use of com.arjuna.wst.UnknownTransactionException in project narayana by jbosstm.
the class UserBusinessActivityStandaloneImple 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));
} catch (InvalidCreateParametersException ex) {
tidyup();
throw new SystemException(ex.toString());
} catch (UnknownTransactionException ex) {
tidyup();
throw new SystemException(ex.toString());
} catch (SystemException ex) {
tidyup();
throw ex;
}
}
Aggregations