if (VERBOSE) writer.fine(exception); throw new RollbackException(exception); } else if (status != Status.STATUS_ACTIVE) { String exception = if (VERBOSE) writer.fine(exception); throw new SystemException(exception); xar = (XAResource) iterator.next(); if (!xar.isSameRM(xaRes)) { LogWriter writer = TransactionUtils.getLogWriter(); if (writer.severeEnabled()) writer.severe( "GlobalTransaction::enlistResource::Only one Resouce Manager supported"); throw new SystemException( "GlobalTransaction::enlistResource::Only one Resouce Manager supported"); } else { new Object[] {e, addon}), e); SystemException sysEx = new SystemException( String.format("GlobalTransaction::enlistResource::error while enlisting XAResource %s %s", new Object[] {e, addon})); sysEx.initCause(e); throw sysEx;
protected boolean calledInsideTransaction() { try { return transactionManager.getStatus() != Status.STATUS_NO_TRANSACTION; } catch (SystemException e) { throw new ActivitiException("Could not determine the current status of the transaction manager: " + e.getMessage(), e); } }
txn.delistResource(xar, XAResource.TMSUCCESS); } catch (SystemException se) { se.printStackTrace();
@Override public final SystemException failedToSend(final Exception e) { final SystemException result = new SystemException(String.format(getLoggingLocale(), failedToSend$str())); result.initCause(e); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String peerSystemException = "WFTXN0012: The peer threw a SystemException; see peer logs for more information";
/** * Get a handle for a specific peer for an XA operation. Identical to {@link #getPeerHandle(URI, SSLContext, AuthenticationConfiguration)} except * that an {@code XAException} is thrown in case of error instead of {@code SystemException}. * * @param location the peer location (not {@code null}) * @param sslContext the sticky SSL context to use (may be {@code null}) * @param authenticationConfiguration the sticky authentication configuration to use (may be {@code null}) * @return the handle, or {@code null} if this provider does not support this location */ default RemoteTransactionPeer getPeerHandleForXa(URI location, SSLContext sslContext, AuthenticationConfiguration authenticationConfiguration) throws XAException { try { return getPeerHandle(location, sslContext, authenticationConfiguration); } catch (SystemException e) { final XAException xaException = new XAException(e.getMessage()); xaException.errorCode = XAException.XAER_RMFAIL; xaException.setStackTrace(e.getStackTrace()); throw xaException; } }
Boolean isActive = (Boolean) resourceMap.get(xaRes); if (isActive.booleanValue()) { xaRes.end(xid, flag); resourceMap.put(xaRes, Boolean.FALSE); if (VERBOSE) writer.fine(exception, e); SystemException se = new SystemException(exception); se.initCause(e);
throw new javax.transaction.SystemException( "TransactionImple.enlistResource - " + jtaLogger.i18NLogger.get_transaction_arjunacore_nullres() ); int status = getStatus(); info = (TxInfo) _resources.get(xaRes); info = (TxInfo) _duplicateResources.get(xaRes); .xaStartParameters(XAResource.TMRESUME)); xaRes.start(info.xid(), xaStartResume); .xaStartParameters(XAResource.TMJOIN)); xaRes.start(info.xid(), xaStartJoin); XAHelper.printXAErrorCode(exp)); TxInfo existingRM = isNewRM(xaRes); if (_resources.size() == 0)// first ever, so no need for xid = createXid(branchRequired, theModifier, xaRes); int timeout = _theTransaction.getTimeout(); throw new javax.transaction.SystemException(
throw new javax.transaction.SystemException( "TransactionImple.delistResource - " + jtaLogger.i18NLogger.get_transaction_arjunacore_nullres() ); int status = getStatus(); break; default: throw new IllegalStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_inactive() ); info = (TxInfo) _resources.get(xaRes); info = (TxInfo) _duplicateResources.get(xaRes); jtaLogger.i18NLogger.warn_transaction_arjunacore_unknownresource("TransactionImple.delistResource"); xaRes.end(info.xid(), XAResource.TMFAIL); xaRes.rollback(info.xid()); xaRes.end(info.xid(), XAResource.TMSUCCESS); info.setState(TxInfo.NOT_ASSOCIATED); markRollbackOnly(); jtaLogger.i18NLogger.warn_transaction_arjunacore_delistresource("TransactionImple.delistResource", XAHelper.printXAErrorCode(exp), exp); markRollbackOnly();
throw new javax.transaction.SystemException( "TransactionImple.delistResource - " + jtaxLogger.i18NLogger.get_jtax_transaction_jts_nullparam()); info = (TxInfo) _resources.get(xaRes); info = (TxInfo) _duplicateResources.get(xaRes); xaRes.end(info.xid(), XAResource.TMFAIL); xaRes.rollback(info.xid()); xaRes.end(info.xid(), XAResource.TMSUCCESS); info.setState(TxInfo.NOT_ASSOCIATED); jtaxLogger.i18NLogger.warn_jtax_transaction_jts_xaerror("TransactionImple.delistResource", XAHelper.printXAErrorCode(exp), exp);
try { manager.getCommitter().commit(manager.getBranchId(), true); synchronized (this) { status = Status.STATUS_COMMITTED; manager.getCommitter().forget(manager.getBranchId()); manager.getCommitter().forget(manager.getBranchId()); throw (HeuristicMixedException) new HeuristicMixedException("Error during one-phase commit").initCause(e); } else if (e.errorCode == XAException.XA_HEURCOM) { throw (SystemException) new SystemException("Error during one phase commit").initCause(e); || cause.errorCode == XAException.XAER_RMERR || cause.errorCode == XAException.XAER_NOTA) { throw (RollbackException) new RollbackException("Error during two phase commit").initCause(cause); } else { throw (SystemException) new SystemException("Error during two phase commit").initCause(cause);
if (isActive.booleanValue()) { xar.end(xid, XAResource.TMSUCCESS); entry.setValue(Boolean.FALSE); xar1.commit(xid, true); status = Status.STATUS_COMMITTED; if (VERBOSE) if (VERBOSE) writer.fine(exception, t); SystemException sysEx = new SystemException(exception); sysEx.initCause(t); throw sysEx; if (VERBOSE) writer.fine(exception, e); RollbackException rbEx = new RollbackException(exception); rbEx.initCause(e); throw rbEx; } finally {
TransactionBranch manager = (TransactionBranch) i.next(); try { manager.getCommitter().rollback(manager.getBranchId()); everRolledback = true; } catch (XAException e) { manager.getCommitter().forget(manager.getBranchId()); } else if (e.errorCode == XAException.XA_HEURMIX) { log.error("Transaction has been heuristically committed and rolled back " + manager.getCommitter() + "; continuing with rollback", e); cause = e; everRolledback = true; manager.getCommitter().forget(manager.getBranchId()); } else if (e.errorCode == XAException.XA_HEURCOM) { log.error("Transaction has been heuristically committed " + manager.getCommitter() + "; continuing with rollback", e); throw (SystemException) new SystemException("System error during commit/rolling back").initCause(e); throw (RollbackException) new RollbackException("Unable to commit: transaction marked for rollback").initCause(cause); } else { if (cause.errorCode == XAException.XA_HEURCOM && everRolledback) { throw (HeuristicMixedException) new HeuristicMixedException("HeuristicMixed error during commit/rolling back").initCause(cause); } else { throw (SystemException) new SystemException("System Error during commit/rolling back").initCause(cause);
entry.getKey().end(entry.getValue(), XAResource.TMSUCCESS); } catch (XAException e) { throw (SystemException) new SystemException(XAException.XAER_RMERR).initCause(e); int prepareStatus = entry.getKey().prepare(entry.getValue()); if (prepareStatus != XAResource.XA_RDONLY) { preparedResources.add(entry.getKey()); throw (SystemException) new SystemException(XAException.XAER_RMERR).initCause(e); try { if (preparedResources.contains(entry.getKey())) { entry.getKey().commit(entry.getValue(), false); throw (SystemException) new SystemException(XAException.XAER_RMERR).initCause(e);
/** * @return the suspended transaction. */ public Transaction suspend() throws javax.transaction.SystemException { if (jtaLogger.logger.isTraceEnabled()) { jtaLogger.logger.trace("TransactionImpleManager.suspend"); } try { TransactionImple tx = TransactionImple.getTransaction(); if (tx != null) { tx.getAtomicAction().suspend(); } return tx; } catch (Exception e) { javax.transaction.SystemException systemException = new javax.transaction.SystemException(e.toString()); systemException.initCause(e); throw systemException; } }
@Override public void rollback() throws IllegalStateException, SystemException { try { Set<Map.Entry<XAResource, TestXid>> entries = xids.entrySet(); // delist for (Map.Entry<XAResource, TestXid> entry : entries) { try { entry.getKey().end(entry.getValue(), XAResource.TMSUCCESS); } catch (XAException e) { throw (SystemException) new SystemException(XAException.XAER_RMERR).initCause(e); } } // rollback for (Map.Entry<XAResource, TestXid> entry : entries) { try { entry.getKey().rollback(entry.getValue()); } catch (XAException e) { throw (SystemException) new SystemException(XAException.XAER_RMERR).initCause(e); } } } finally { fireAfterCompletion(Status.STATUS_ROLLEDBACK); } }
public Transaction begin(long transactionTimeoutMilliseconds) throws NotSupportedException, SystemException { if (getStatus() != Status.STATUS_NO_TRANSACTION) { throw new NotSupportedException("Nested Transactions are not supported"); } TransactionImpl tx = new TransactionImpl(xidFactory, transactionLog, getTransactionTimeoutMilliseconds(transactionTimeoutMilliseconds)); // timeoutTimer.schedule(tx, getTransactionTimeoutMilliseconds(transactionTimeoutMilliseconds)); try { associate(tx); } catch (InvalidTransactionException e) { // should not be possible since we just created that transaction and no one has a reference yet throw (SystemException)new SystemException("Internal error: associate threw an InvalidTransactionException for a newly created transaction").initCause(e); } // Todo: Verify if this is correct thing to do. Use default timeout for next transaction. this.transactionTimeoutMilliseconds.set(null); return tx; }
AtomicAction act = ((theTransaction == null) ? null : theTransaction.getAtomicAction()); if (!AtomicAction.resume(act)) throw new InvalidTransactionException(); javax.transaction.SystemException systemException = new javax.transaction.SystemException(); systemException.initCause(e2); throw systemException;
throw new SystemException( "TransactionManager invalid"); if (VERBOSE) log.fine(exception); throw new NotSupportedException(exception); log.severe(String.format("SystemException due to %s", new Object[] {e})); throw new SystemException(exception);
@Override public boolean enlistResource(XAResource xaRes) throws IllegalStateException, SystemException { TestXid testXid = xids.get(xaRes); if (testXid == null) { testXid = new TestXid(gtrid, bqualGenerator.incrementAndGet()); xids.put(xaRes, testXid); } try { xaRes.start(testXid, XAResource.TMNOFLAGS); } catch (XAException e) { throw (SystemException) new SystemException(XAException.XAER_RMERR).initCause(e); } return true; }
public void registerSynchronization(javax.transaction.Synchronization sync) throws javax.transaction.RollbackException, java.lang.IllegalStateException, javax.transaction.SystemException { if (jtaLogger.logger.isTraceEnabled()) { jtaLogger.logger.trace("TransactionImple.registerSynchronization"); } if (sync == null) { throw new javax.transaction.SystemException( "TransactionImple.registerSynchronization - " + jtaLogger.i18NLogger.get_transaction_arjunacore_nullparam() ); } registerSynchronizationImple(new SynchronizationImple(sync, false)); }