@Override public final InvalidTransactionException invalidTransactionConnection() { final InvalidTransactionException result = new InvalidTransactionException(String.format(getLoggingLocale(), invalidTransactionConnection$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String noTransactionXa = "WFTXN0070: No such transaction";
@Override public final InvalidTransactionException notSupportedTransaction(final Transaction transaction) { final InvalidTransactionException result = new InvalidTransactionException(String.format(getLoggingLocale(), notSupportedTransaction$str(), transaction)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String invalidTransactionLocationUri = "WFTXN0003: Invalid transaction location URI (must be absolute): %s";
@Override public final InvalidTransactionException transactionNotAssociatedWithThisProvider() { final InvalidTransactionException result = new InvalidTransactionException(String.format(getLoggingLocale(), transactionNotAssociatedWithThisProvider$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String negativeTxnTimeout = "WFTXN0006: Negative transaction timeout provided";
public void resume(javax.transaction.Transaction tobj) throws InvalidTransactionException, IllegalStateException, SystemException { TransactionManager transactionManager = this.beanFactory.getTransactionManager(); CompensableManager compensableManager = this.beanFactory.getCompensableManager(); if (org.bytesoft.transaction.Transaction.class.isInstance(tobj) == false) { throw new InvalidTransactionException(); } org.bytesoft.transaction.Transaction transaction = (org.bytesoft.transaction.Transaction) tobj; org.bytesoft.transaction.Transaction compensable = // (org.bytesoft.transaction.Transaction) transaction.getTransactionalExtra(); if (compensable == null) { transactionManager.resume(tobj); } else { org.bytesoft.compensable.TransactionContext compensableContext = // (org.bytesoft.compensable.TransactionContext) compensable.getTransactionContext(); (compensableContext.isCompensable() ? compensableManager : transactionManager).resume(tobj); } }
public void resume(javax.transaction.Transaction tobj) throws InvalidTransactionException, IllegalStateException, SystemException { if (Transaction.class.isInstance(tobj)) { TransactionManager transactionManager = this.beanFactory.getTransactionManager(); Transaction transaction = (Transaction) tobj; CompensableTransaction compensable = (CompensableTransaction) transaction.getTransactionalExtra(); compensable.setTransactionalExtra(transaction); compensable.resume(); TransactionContext compensableContext = compensable.getTransactionContext(); compensableContext.setPropagationLevel(compensableContext.getPropagationLevel() - 1); transactionManager.resume(transaction); } else { throw new InvalidTransactionException(); } }
if (VERBOSE) writer.fine(exception); throw new InvalidTransactionException(exception); if (VERBOSE) writer.fine(exception); throw new InvalidTransactionException(exception);
@Override public Object apply(ProceedingJoinPoint joinPoint, Compensable compensable, CompensableInterceptor interceptor, OmegaContext context, String parentTxId, int retries) throws Throwable { Method method = ((MethodSignature) joinPoint.getSignature()).getMethod(); LOG.debug("Intercepting compensable method {} with context {}", method.toString(), context); String compensationSignature = compensable.compensationMethod().isEmpty() ? "" : compensationMethodSignature(joinPoint, compensable, method); String retrySignature = (retries != 0 || compensationSignature.isEmpty()) ? method.toString() : ""; AlphaResponse response = interceptor.preIntercept(parentTxId, compensationSignature, compensable.timeout(), retrySignature, retries, joinPoint.getArgs()); if (response.aborted()) { String abortedLocalTxId = context.localTxId(); context.setLocalTxId(parentTxId); throw new InvalidTransactionException("Abort sub transaction " + abortedLocalTxId + " because global transaction " + context.globalTxId() + " has already aborted."); } try { Object result = joinPoint.proceed(); interceptor.postIntercept(parentTxId, compensationSignature); return result; } catch (Throwable throwable) { interceptor.onError(parentTxId, compensationSignature, throwable); throw throwable; } }
@Override public void resume(Transaction tobj) throws InvalidTransactionException, IllegalStateException, SystemException { if (ACTIVE_TRANSACTION.get().isPresent()) { throw new IllegalStateException("Current thread has a tx associated"); } if (!(tobj instanceof LocalTransaction)) { throw new InvalidTransactionException(tobj + " is not a valid local transaction"); } ACTIVE_TRANSACTION.set(Optional.of((LocalTransaction) tobj)); } }
@Override public void resume(Transaction tobj) throws InvalidTransactionException, IllegalStateException, SystemException { if (ACTIVE_TRANSACTION.get().isPresent()) { throw new IllegalStateException("Current thread has a tx associated"); } if (!(tobj instanceof LocalTransaction)) { throw new InvalidTransactionException(tobj + " is not a valid local transaction"); } ACTIVE_TRANSACTION.set(Optional.of((LocalTransaction) tobj)); } }
@Override protected Object doIntercept(TransactionManager tm, Transaction tx, InvocationContext ic) throws Exception { if (tx != null) { throw new TransactionalException(jtaLogger.i18NLogger.get_tx_required(), new InvalidTransactionException()); } return invokeInNoTx(ic); } }
@Override protected Object doIntercept(TransactionManager tm, Transaction tx, InvocationContext ic) throws Exception { if (tx != null) { throw new TransactionalException(jtaLogger.i18NLogger.get_tx_required(), new InvalidTransactionException()); } return invokeInNoTx(ic); } }
public void resume(Transaction tx) throws IllegalStateException, InvalidTransactionException, SystemException { if (getTransaction() != null) { throw new IllegalStateException("Thread already associated with another transaction"); } if (!(tx instanceof TransactionImpl)) { throw new InvalidTransactionException("Cannot resume foreign transaction: " + tx); } associate((TransactionImpl) tx); }
@AroundInvoke public Object intercept(final InvocationContext ic) throws Exception { try { return super.intercept(ic); } catch (final RemoteException re) { throw new TransactionalException(re.getMessage(), new InvalidTransactionException(re.getMessage())); } }
public void resume(javax.transaction.Transaction tobj) throws InvalidTransactionException, IllegalStateException, RollbackRequiredException, SystemException { if (TransactionImpl.class.isInstance(tobj) == false) { throw new InvalidTransactionException(); } else if (this.getTransaction() != null) { throw new IllegalStateException(); } TransactionImpl transaction = (TransactionImpl) tobj; transaction.resume(); this.associateThread(transaction); }
@Override public final InvalidTransactionException transactionNotAssociatedWithThisProvider() { final InvalidTransactionException result = new InvalidTransactionException(String.format(getLoggingLocale(), transactionNotAssociatedWithThisProvider$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String negativeTxnTimeout = "WFTXN0006: Negative transaction timeout provided";
@Override public final InvalidTransactionException notSupportedTransaction(final Transaction transaction) { final InvalidTransactionException result = new InvalidTransactionException(String.format(getLoggingLocale(), notSupportedTransaction$str(), transaction)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String invalidTransactionLocationUri = "WFTXN0003: Invalid transaction location URI (must be absolute): %s";
@Override public final InvalidTransactionException notSupportedTransaction(final Transaction transaction) { final InvalidTransactionException result = new InvalidTransactionException(String.format(getLoggingLocale(), notSupportedTransaction$str(), transaction)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String invalidTransactionLocationUri = "WFTXN0003: Invalid transaction location URI (must be absolute): %s";
public void resume(Transaction tx) throws IllegalStateException, InvalidTransactionException, SystemException { if (getTransaction() != null && tx != getTransaction()) { throw new IllegalStateException("Thread already associated with another transaction"); } if (tx != null && tx != getTransaction()) { if (!(tx instanceof TransactionImpl)) { throw new InvalidTransactionException("Cannot resume foreign transaction: " + tx); } associate((TransactionImpl) tx); } }
public void resume(Transaction tx) throws IllegalStateException, InvalidTransactionException, SystemException { if (getTransaction() != null && tx != getTransaction()) { throw new IllegalStateException("Thread already associated with another transaction"); } if (tx != null && tx != getTransaction()) { if (!(tx instanceof TransactionImpl)) { throw new InvalidTransactionException("Cannot resume foreign transaction: " + tx); } associate((TransactionImpl) tx); } }
public void resume(Transaction tx) throws IllegalStateException, InvalidTransactionException, SystemException { if (getTransaction() != null && tx != getTransaction()) { throw new IllegalStateException("Thread already associated with another transaction"); } if (tx != null && tx != getTransaction()) { if (!(tx instanceof TransactionImpl)) { throw new InvalidTransactionException("Cannot resume foreign transaction: " + tx); } associate((TransactionImpl) tx); } }