if (VERBOSE) writer.fine(exception); throw new RollbackException(exception); } else if (status != Status.STATUS_ACTIVE) { String exception = xaRes.start(xid, XAResource.TMNOFLAGS); int delay = (int) ((expirationTime - System.currentTimeMillis()) / 1000); try { if (!DISABLE_TRANSACTION_TIMEOUT_SETTING) { xaRes.setTransactionTimeout(delay); if (VERBOSE) writer.fine(exception); throw new SystemException(exception); xar = (XAResource) iterator.next(); new Object[] {e, addon}), e); SystemException sysEx = new SystemException( String.format("GlobalTransaction::enlistResource::error while enlisting XAResource %s %s", new Object[] {e, addon}));
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 {
String.format( "FacetsJCAConnectionManagerImpl:: An Exception was caught while allocating a connection due to %s", ex.getMessage()); throw new ResourceException(exception, ex); } catch (SystemException ex) { String.format( "FacetsJCAConnectionManagerImpl:: allocateConnection :system exception due to %s", ex.getMessage()), ex);
@Override public final RollbackException rollbackOnlyRollback() { final RollbackException result = new RollbackException(String.format(getLoggingLocale(), rollbackOnlyRollback$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String invalidTxnState = "WFTXN0018: Invalid transaction state";
HeuristicMixedException, SystemException { if (!isActive) { throw new SystemException( "TransactionManager invalid"); if (VERBOSE) writer.fine(exception); throw new SystemException(exception); if (VERBOSE) writer.fine(exception, e); RollbackException re = new RollbackException(exception); re.initCause(e); throw re; if (VERBOSE) writer.fine(exception, e); throw new RollbackException(exception);
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); throw (HeuristicRollbackException) new HeuristicRollbackException("Error during two phase commit").initCause(cause); } else if (cause.errorCode == XAException.XA_HEURMIX) { throw (HeuristicMixedException) new HeuristicMixedException("Error during two phase commit").initCause(cause); } else if (cause.errorCode == XAException.XA_RBROLLBACK || 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);
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 if (cause.errorCode == XAException.XA_HEURMIX) { 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);
int status = getStatus(); throw new RollbackException( "TransactionImple.enlistResource - " + jtaLogger.i18NLogger.get_transaction_arjunacore_invalidstate() ); case javax.transaction.Status.STATUS_ACTIVE: break; default: throw new IllegalStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_inactive() ); .xaStartParameters(XAResource.TMRESUME)); xaRes.start(info.xid(), xaStartResume); .xaStartParameters(XAResource.TMJOIN)); xaRes.start(info.xid(), xaStartJoin); TxInfo existingRM = isNewRM(xaRes); xid = createXid(branchRequired, theModifier, xaRes); int timeout = _theTransaction.getTimeout(); xaRes.setTransactionTimeout(timeout); markRollbackOnly();
switch (_theTransaction.status()) _theTransaction.abort(); // assure thread disassociation throw new javax.transaction.RollbackException( jtaLogger.i18NLogger.get_transaction_arjunacore_inactive() ); break; case ActionStatus.H_MIXED: throw new javax.transaction.HeuristicMixedException(); case ActionStatus.H_HAZARD: throw new javax.transaction.HeuristicMixedException(); case ActionStatus.H_ROLLBACK: case ActionStatus.ABORTED: case ActionStatus.ABORTING: RollbackException rollbackException = new RollbackException( jtaLogger.i18NLogger.get_transaction_arjunacore_commitwhenaborted() ); rollbackException.initCause(preexistingRollbackOnlyCallerStacktrace); } else if(_theTransaction.getDeferredThrowable() != null) { rollbackException.initCause(_theTransaction.getDeferredThrowable()); } else if(_rollbackOnlyCallerStacktrace != null) { rollbackException.initCause(_rollbackOnlyCallerStacktrace); throw new InvalidTerminationStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_invalidstate() ); TransactionImple.removeTransaction(this);
switch (_theTransaction.status()) break; default: throw new IllegalStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_inactive() ); if (!endSuspendedRMs()) _theTransaction.preventCommit(); int status = _theTransaction.end(true); TransactionImple.removeTransaction(this); break; case ActionStatus.H_MIXED: throw new javax.transaction.HeuristicMixedException(); case ActionStatus.H_HAZARD: throw new javax.transaction.HeuristicMixedException(); case ActionStatus.H_ROLLBACK: case ActionStatus.ABORTED: RollbackException rollbackException = new RollbackException( jtaLogger.i18NLogger.get_transaction_arjunacore_commitwhenaborted() ); if (_theTransaction.getDeferredThrowable() != null) rollbackException.initCause(_theTransaction .getDeferredThrowable()); throw new IllegalStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_invalidstate() );
throw new SystemException( "TransactionImpl::registerSynchronization:Synchronization is null"); gtx = tm.getGlobalTransaction(); if (gtx == null) { throw new SystemException( "no transaction present"); if (writer.fineEnabled()) writer.fine(exception); throw new RollbackException(exception); } else if (status != Status.STATUS_ACTIVE) { String exception =
throw new SystemException("enlistResource: null argument"); throw new SystemException("enlistResource: no Transactional Context"); if (subcoord == null) { TraceTm.jotm.error("enlistResource: could not create subcoordinator"); throw new SystemException("enlistResource: could not create subcoordinator"); xares.start(javaxxid, flag); } catch (XAException e) { String error = "Cannot send XA(" + xares + ") start:" + e + " (error code = " + e.errorCode + ") --" throw new IllegalStateException("Transaction already committed."); case Status.STATUS_MARKED_ROLLBACK: throw new RollbackException("Transaction already marked for rollback"); case Status.STATUS_ROLLING_BACK: throw new RollbackException("Transaction already started rolling back."); case Status.STATUS_ROLLEDBACK: throw new RollbackException("Transaction already rolled back."); case Status.STATUS_NO_TRANSACTION: throw new IllegalStateException("No current transaction.");
void registerSynchronizationImple(SynchronizationImple synchronizationImple) throws javax.transaction.RollbackException, java.lang.IllegalStateException, javax.transaction.SystemException { if (_theTransaction != null) { if (_theTransaction.addSynchronization(synchronizationImple) != AddOutcome.AR_ADDED) { int status = _theTransaction.status(); switch (status) { case ActionStatus.ABORT_ONLY: case ActionStatus.ABORTED: throw new javax.transaction.RollbackException( jtaLogger.i18NLogger.get_transaction_arjunacore_syncwhenaborted() ); case ActionStatus.CREATED: throw new IllegalStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_inactive(_theTransaction.get_uid()) ); default: throw new IllegalStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_syncsnotallowed() + ActionStatus.stringForm(status)); } } } else throw new IllegalStateException( jtaLogger.i18NLogger.get_transaction_arjunacore_inactive() ); }
private static void rethrowAsJtaRollbackException(String msg, Throwable cause) throws javax.transaction.RollbackException { javax.transaction.RollbackException ret = new javax.transaction.RollbackException( msg); ret.initCause(cause); throw ret; }
_theTransaction.preventCommit(); throw new RollbackException(); case ActionStatus.INVALID: throw new InvalidTerminationStateException(); case ActionStatus.H_MIXED: default: throw new javax.transaction.HeuristicMixedException(); jtaLogger.i18NLogger.error_transaction_class_cast_fail(super._theTransaction, ex);
res.setTransactionTimeout(tm.getXAResourceTimeOut()); }catch(Exception ex){ _logger.log(Level.WARNING,"jts.error_while_setting_xares_txn_timeout",ex); throw new RollbackException(); throw new SystemException();
switch (_theTransaction.status()) _theTransaction.abort(); // assure thread disassociation throw new javax.transaction.RollbackException( jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.inactive")); _theTransaction.commit(true); // assure thread disassociation return; break; case ActionStatus.H_MIXED: throw new javax.transaction.HeuristicMixedException(); case ActionStatus.H_HAZARD: throw new javax.transaction.HeuristicMixedException(); case ActionStatus.H_ROLLBACK: case ActionStatus.ABORTED: case ActionStatus.ABORTING: RollbackException rollbackException = new RollbackException(jtaLogger.logMesg.getString("com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted")); if(_rollbackOnlyCallerStacktrace != null) { rollbackException.initCause(_rollbackOnlyCallerStacktrace); else if(_theTransaction.getDeferredThrowable() != null) { rollbackException.initCause(_theTransaction.getDeferredThrowable()); TransactionImple.removeTransaction(this);
public synchronized void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException { if (this.transactionStatus == Status.STATUS_ACTIVE) { this.fireCommit(); } else if (this.transactionStatus == Status.STATUS_MARKED_ROLLBACK) { this.fireRollback(); throw new HeuristicRollbackException(); } else if (this.transactionStatus == Status.STATUS_ROLLEDBACK) /* should never happen */ { throw new RollbackException(); } else if (this.transactionStatus == Status.STATUS_COMMITTED) /* should never happen */ { logger.debug("Current transaction has already been committed."); } else { throw new IllegalStateException(); } }
statusRef.set(Status.STATUS_UNKNOWN); final HeuristicMixedException e = Log.log.peerHeuristicMixedException(); e.initCause(RemoteExceptionCause.readFromStream(is)); throw e; } else if (id == Protocol.P_UT_HRE_EXC) { statusRef.set(Status.STATUS_ROLLEDBACK); final RollbackException e = Log.log.transactionRolledBackByPeer(); e.initCause(RemoteExceptionCause.readFromStream(is)); throw e; } else if (id == Protocol.P_UT_SYS_EXC) { final SystemException e = Log.log.peerSystemException(); e.errorCode = is.readInt(); e.initCause(RemoteExceptionCause.readFromStream(is)); throw e; } else if (id == Protocol.P_SEC_EXC) {
_theTransaction.preventCommit(); throw new RollbackException(); case ActionStatus.INVALID: throw new InvalidTerminationStateException(); case ActionStatus.H_MIXED: default: throw new javax.transaction.HeuristicMixedException();