Rollback.

@see javax.transaction.UserTransaction#rollback()
@throws SystemException on error
341162
@Override
    public void rollback()
        throws SystemException
    {
        try {
            Context.rollback();
        } catch (final EFapsException e) {
            throw new SystemException(e.getMessage());
        }
    }
89039
@Override
   public void setRollbackOnly() throws IllegalStateException, SystemException {
      if (trace) {
         log.tracef("Transaction.setRollbackOnly() invoked in transaction with Xid=%s", xid);
      }
      if (isDone()) {
         throw new IllegalStateException("Transaction is done. Cannot change status");
      }
      markRollbackOnly(new RollbackException("Transaction marked as rollback only."));
   }
221125
private function rollback()
    {
        // We only need to rollback if we are in a transaction. Otherwise the resulting
        // error would hide the real problem why rollback was called. We might not be
        // in a transaction when not using the transactional locking behavior or when
        // two callbacks (e.g. destroy and write) are invoked that both fail.
        if ($this->inTransaction) {
            if ('sqlite' === $this->driver) {
                $this->pdo->exec('ROLLBACK');
            } else {
                $this->pdo->rollBack();
            }
            $this->inTransaction = false;
        }
    }
813465
public void commitTransaction() throws SystemException
   {
      Long key = Long.valueOf(Thread.currentThread().getId());
      TransactionImpl tx = txs.get(key);
      if (tx != null)
      {
         try
         {
            tx.commit();
         }
         catch (Throwable t)
         {
            SystemException se = new SystemException("Error during commit");
            se.initCause(t);
            throw se;
         }
      }
      else
      {
         throw new IllegalStateException("No transaction to commit");
      }
   }
258120
public synchronized void rollback() throws HeuristicCommitException, HeuristicMixedException, HeuristicHazardException, SystemException
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "rollback", this);

        // Ensure timeout cannot rollback the underlying transaction
        ((DistributableTransaction) _transaction).addAssociation();

        boolean sysException = false;

        // Cancel any outstanding (in-doubt or transaction) timer
        EmbeddableTimeoutManager.setTimeout(_transaction, EmbeddableTimeoutManager.CANCEL_TIMEOUT, 0);

        final int state = _transaction.getTransactionState().getState();
        switch (state)
        {
            case TransactionState.STATE_ACTIVE:
            case TransactionState.STATE_PREPARED:
                try
                {
                    _transaction.getTransactionState().setState(TransactionState.STATE_ROLLING_BACK);
                } catch (javax.transaction.SystemException se)
                {
                    FFDCFilter.processException(se, "com.ibm.tx.remote.TransactionWrapper.rollback", "586", this);
                    if (tc.isDebugEnabled())
                        Tr.debug(tc, "Exception caught setting state to ROLLING_BACK!", se);
                    sysException = true;
                }

                try
                {
                    // Resume the transaction created from the incoming
                    // request so that it is installed on the thread.
                    ((EmbeddableTranManagerSet) TransactionManagerFactory.getTransactionManager()).resume(_transaction);

                    _transaction.internalRollback();
                    _transaction.notifyCompletion();
                } catch (HeuristicMixedException hme)
                {
                    // No FFDC code needed.
                    _heuristic = StatefulResource.HEURISTIC_MIXED;
                } catch (HeuristicHazardException hhe)
                {
                    // No FFDC code needed.
                    _heuristic = StatefulResource.HEURISTIC_HAZARD;
                } catch (HeuristicCommitException hce)
                {
                    // No FFDC code needed.
                    _heuristic = StatefulResource.HEURISTIC_COMMIT;
                } catch (Throwable exc) // javax.transaction.SystemException
                {
                    FFDCFilter.processException(exc, "com.ibm.tx.remote.TransactionWrapper.rollback", "610", this);
                    Tr.error(tc, "WTRN0071_ROLLBACK_FAILED", exc);
                    _transaction.notifyCompletion();
                    sysException = true;
                }
                break;

            // If the transaction that this object represents has already been completed,
            // raise a heuristic exception if necessary.  This object must wait for a
            // forget before destroying itself if it returns a heuristic exception.

            case TransactionState.STATE_HEURISTIC_ON_ROLLBACK:
            case TransactionState.STATE_ROLLED_BACK:
                // Return last heuristic value and allow for recovery
                _heuristic = _transaction.getResources().getHeuristicOutcome();
                break;

            case TransactionState.STATE_ROLLING_BACK:
                // We should only get in this state if we are in recovery and this
                // inbound rollback arrives.  In other cases, if we are rolling back
                // we will hold out using the association counts and if we are
                // locally retrying we will be in a heuristic state as we returned
                // heuristic hazard to the superior.
                ((DistributableTransaction) _transaction).removeAssociation();
                final TRANSIENT tre = new TRANSIENT();
                if (tc.isEntryEnabled())
                    Tr.exit(tc, "rollback", tre);
                throw tre;

            case TransactionState.STATE_COMMITTING:
            case TransactionState.STATE_HEURISTIC_ON_COMMIT:
            case TransactionState.STATE_COMMITTED:
                // Admin heuristic commit ...
                // again retry ... respond with heurcom
                _heuristic = StatefulResource.HEURISTIC_COMMIT;
                break;

            case TransactionState.STATE_NONE:
                // Transaction has completed and is now finished
                // Normally the remoteable object would be disconnected from the orb,
                // but ... timing may mean get got here while it was happenning
                // We could just return ok, but it is more true to return exception
                ((DistributableTransaction) _transaction).removeAssociation();
                final OBJECT_NOT_EXIST one = new OBJECT_NOT_EXIST();
                if (tc.isEntryEnabled())
                    Tr.exit(tc, "rollback", one);
                throw one;

            default:
                Tr.error(tc, "WTRN0072_ROLLBACK_BAD_STATE", TransactionState.stateToString(state));
                sysException = true;
                _transaction.notifyCompletion();
                break;
        } // end switch

        ((DistributableTransaction) _transaction).removeAssociation();

        switch (_heuristic)
        {
            case StatefulResource.NONE:
                break;

            case StatefulResource.HEURISTIC_HAZARD:
//                _transaction.addHeuristic();
                final HeuristicHazardException hh = new HeuristicHazardException();
                if (tc.isEntryEnabled())
                    Tr.exit(tc, "rollback", hh);
                throw hh;

            case StatefulResource.HEURISTIC_COMMIT:
//                _transaction.addHeuristic();
                final HeuristicCommitException hc = new HeuristicCommitException();
                if (tc.isEntryEnabled())
                    Tr.exit(tc, "rollback", hc);
                throw hc;

            default:
//                _transaction.addHeuristic();
                final HeuristicMixedException hm = new HeuristicMixedException();
                if (tc.isEntryEnabled())
                    Tr.exit(tc, "rollback", hm);
                throw hm;
        }

        if (sysException)
        {
            // destroy();
            final INTERNAL ie = new INTERNAL(MinorCode.LOGIC_ERROR, null);
            if (tc.isEntryEnabled())
                Tr.exit(tc, "rollback", ie);
            throw ie;
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, "rollback");
    }
407289
public function rollbackTransaction()
    {
        if ($this->isTransactionEnabled() === false) {
            throw new ServiceException(sprintf(
                'The repository for %s doesn\'t support Transactions',
                $this->getEntityServiceName()
            ));
        }

        $this->getRepository()->rollbackTransaction();
    }
667274
@Override
    public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException,
            SecurityException, IllegalStateException, SystemException
    {
        Transaction tx = threadLocal.get();

        try
        {
            if (tx != null)
            {
                if (log.isDebugEnabled())
                    log.info("Commiting transaction:" + tx);
                tx.commit();
            }
            else
            {
                log.debug("Cannot locate a transaction to commit.");

            }
        }
        finally
        {
            if (log.isDebugEnabled())
                log.info("Resetting after commit.");
            threadLocal.set(null);
            timerThead.set(null);
        }
    }
706038
@Override
	public void rollback() throws TransactionManagementException {
		logger.entering(CLASSNAME, "rollback");
		try {
			if (userTran.getStatus() != Status.STATUS_NO_TRANSACTION) {
				userTran.rollback();
			}
			logger.log(Level.FINE, "javax.transaction.Status: {0}", userTran.getStatus());
		} catch (IllegalStateException e) {
			throw new TransactionManagementException(e);
		} catch (SecurityException e) {
			throw new TransactionManagementException(e);
		} catch (SystemException e) {
			throw new TransactionManagementException(e);
		}
		logger.exiting(CLASSNAME, "rollback");
	}
789317
@Override
	public void rollback() {
		if (conn != null) {
			try {
				conn.rollback();
			} catch (SQLException e) {
				throw new UroborosqlSQLException(e);
			}
		}
	}
758512
public function rollBack()
    {
        if($this->mysqliRef->rollback()) {
            $this->log("rollback");
            return;
        }
        $mex = "Mysql error: it is not possible perform the rollback. ".$this->mysqliRef->error;
        $this->log($mex);
        throw new MysqltcsException($mex);
    }
785498
public void rollback(final Xid xid) throws XAException {

        final String methodName = "rollback";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName, xid);
        }

        _siXaResource.rollback(xid);

        // Add the value true to indicate we have rolled back to the hashtable of
        // stats (keying off the xid)
        synchronized (_transactionStates) {

          _transactionStates.put (xid, Boolean.TRUE);

          if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
            StringBuffer sb = new StringBuffer ("After adding the xid ");
            sb.append (xid);
            sb.append (" the hashtable of transactionStates now contains ");
            sb.append (_transactionStates.size());
            sb.append (" entries");
            SibTr.debug (this, TRACE, sb.toString());
          }

        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }

    }
1371149
@Override
    public synchronized void rollback(boolean chain) {

        //        tempActionHistory.add("rollback " + actionTimestamp);
        if (isClosed) {
            return;
        }

        if (!isTransaction) {
            isReadOnly    = isReadOnlyDefault;
            isolationMode = isolationModeDefault;

            return;
        }

        try {
            database.logger.writeToLog(this, Tokens.T_ROLLBACK);
        } catch (HsqlException e) {}

        database.txManager.rollback(this);
        endTransaction(false);
    }
1147606
public function rollBack() {
		if ($this->transactionManager === null) {
			$this->performRollBack();
			return;
		}
		
		if ($this->transactionManager->hasOpenTransaction()) {
			$this->transactionManager->getRootTransaction()->rollBack();
		}
	}
70770
public int rollback() {
      //log rolling back
      loggingDecision(false);

      //perform rollback
      try {
         tx.rollback();
      } catch (SystemException e) {
         //ignore exception (heuristic exceptions)
         //TODO logging
      } finally {
         perCacheTxTable.removeLocalTx(xid);
      }

      //log rolled back
      loggingCompleted(false);
      return XAException.XA_RBROLLBACK;
   }
702862
@Override
    public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException,
            SecurityException, IllegalStateException, SystemException
    {
        if (!setRollBackOnly)
        {
            for (ResourceManager implementor : implementors)
            {
                if (implementor != null)
                {
                    implementor.doCommit();
                }
            }
            status = Status.STATUS_COMMITTED;
        }
        else
        {
            if (log.isDebugEnabled())
                log.debug("Transaction is set for rollback only, processing rollback.");

            for (ResourceManager implementor : implementors)
            {
                if (implementor != null)
                {
                    implementor.doRollback();
                    status = Status.STATUS_ROLLEDBACK;
                }
            }
        }

    }
1360655
public void rollbackTransaction() throws HibernateException
    {
        Transaction tx = threadTransaction.get();
        try
        {
            threadTransaction.set(null);
            if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack())
            {
                tx.rollback();
            }
        }
        finally
        {
            closeSession();
        }
    }
146010
@Override
    public void rollback(String globalId) throws HeuristicHazardException, HeuristicCommitException, HeuristicMixedException, SystemException {

        final TransactionWrapper t = TransactionWrapper.getTransactionWrapper(globalId);

        if (t != null) {
            t.rollback();
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "No matching TransactionWrapper: " + globalId);
            throw new SystemException();
        }
    }