Cancel transaction
166636
public function cancel() {
        switch ($this->state) {
            case self::STATE_SHEDULED:
                $this->state = self::STATE_NONE;
                $this->counter = 0;
                break;
        }
        return false;
    }
1336921
def cancel(id)
      have_key?
      address = @url_private + "/trade_cancel/"
      params = {
        "id" => id,
      }
      h = post_ssl_with_sign(address, params)
      {
        "success" => h["result"],
      }
    end
882998
def UndoTransaction(self):
		
		from Ucs import ConfigMap

		self._transactionInProgress = False
		self._configMap = ConfigMap()
157577
def cancel(self):
        

        method, url = get_URL('cancel')

        payload = {
            'apikey': self.config.get('apikey'),
            'transferid': self.transfer_id,
            'transferkey': self.transfer_info.get('transferkey')
            }

        res = getattr(self.session, method)(url, params=payload)

        if res.status_code == 200:
            self._complete = True
            return True

        hellraiser(res)
1121515
public synchronized void cancelMessageRequest(boolean discard)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "cancelMessageRequest", new Boolean(discard));
      
    SIMPTransactionManager txManager = messageProcessor.getTXManager();
    LocalTransaction tran = null;
    
    try
    {
      MessageItem msg = (MessageItem)getSIMPMessage();
      
      
      if(discard)
      {
        if(msg!=null)
        {
          tran = txManager.createLocalTransaction(false);
          Transaction msTran = messageProcessor.resolveAndEnlistMsgStoreTransaction(tran);

          // Cleanup the AOValue and the Msg
          aoStream.syncRemoveValueTick(tick, msTran, msg);
          
          tran.commit();
        }
        else
        {
          //if the request was not in the value state, then we simply expire
          //the request
          aoStream.expiredRequest(tick, true);          
        }
      }
      else
      {  
        if(msg!=null) 
        {          
          tran = txManager.createLocalTransaction(false);
          Transaction msTran = messageProcessor.resolveAndEnlistMsgStoreTransaction(tran);
          
          // Cleanup the AOValue
          aoStream.syncRemoveValueTick(tick, msTran, null);
          
          if(msg.isInStore())
          {
            long lockID = msg.getLockID();
            if(lockID!=AbstractItem.NO_LOCK_ID)
            {
              //unlock the message for others to consume it etc
              msg.unlockMsg(lockID, msTran, true);
            }  
          }
          tran.commit();
        }
        else
          //if the request was not in the value state, then we simply expire
          //the request
          aoStream.expiredRequest(tick, true); 
      }
    }
    catch(MessageStoreException e)
    {
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.runtime.TransmitMessageRequest.cancelMessageRequest",
        "1:644:1.48",
        this); 
        
      SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
        new Object[] { "com.ibm.ws.sib.processor.runtime.TransmitMessageRequest.cancelMessageRequest", 
                       "1:649:1.48", 
                       SIMPUtils.getStackTrace(e) });
      SibTr.exception(tc, e);
      
      try
      {
        if (tran!=null)
          tran.rollback();
      }
      catch (SIException ee)
      {
        // No FFDC code needed
        SibTr.exception(tc, e);
      }
    }
    catch (SIException e)
    {
      FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.runtime.TransmitMessageRequest.cancelMessageRequest",
          "1:669:1.48",
          this); 
          
        SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
          new Object[] { "com.ibm.ws.sib.processor.runtime.TransmitMessageRequest.cancelMessageRequest", 
                         "1:674:1.48", 
                         SIMPUtils.getStackTrace(e) });
        SibTr.exception(tc, e); 
        
        try
        {
          if (tran!=null)
            tran.rollback();
        }
        catch (SIException ee)
        {
          // No FFDC code needed
          SibTr.exception(tc, e);
        }

    }  

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "cancelMessageRequest");
  }
993558
def cancel(self, refund=True):
        
        if refund:
            self.refund()
        self.status = self.CANCELLED
        self.save()
767509
def cancel(self):
        """"""
        if self in scoop._control.execQueue.movable:
            self.exceptionValue = CancelledError()
            scoop._control.futureDict[self.id]._delete()
            scoop._control.execQueue.remove(self)
            return True
        return False
375327
def cancel_withdraw(self, address_id, _async=False):
        
        params = {}
        path = f'/v1/dw/withdraw-virtual/{address_id}/cancel'

        return api_key_post(params, path, _async=_async)
990336
public function cancelTransaction($transactionCode)
    {
        return $this->sendTransaction([
            'email'           => $this->email,
            'token'           => $this->token,
            'transactionCode' => $transactionCode,
        ], $this->url['cancelTransaction']);
    }
866360
public void abortTransaction(String scope, String streamName, Duration latency) {
        DYNAMIC_LOGGER.incCounterValue(globalMetricName(ABORT_TRANSACTION), 1);
        DYNAMIC_LOGGER.incCounterValue(ABORT_TRANSACTION, 1, streamTags(scope, streamName));
        abortTransactionLatency.reportSuccessValue(latency.toMillis());
    }
178787
def action_cancel(self):
        """"""
        self.write({'state': 'cancelled'})
        for rec in self:
            rec.message_post(
                subtype='mt_comment',
                body=_(
                    'Change request <b>%s</b> has been cancelled by %s.'
                    ) % (rec.display_name, self.env.user.name)
                )
693950
public synchronized void abortTransaction() throws TransactionNotInProgressException
    {
        if(isInTransaction())
        {
            fireBrokerEvent(BEFORE_ROLLBACK_EVENT);
            setInTransaction(false);
            clearRegistrationLists();
            referencesBroker.removePrefetchingListeners();
            /*
            arminw:
            check if we in local tx, before do local rollback
            Necessary, because ConnectionManager may do a rollback by itself
            or in managed environments the used connection is already be closed
            */
            if(connectionManager.isInLocalTransaction()) this.connectionManager.localRollback();
            fireBrokerEvent(AFTER_ROLLBACK_EVENT);
        }
    }
918914
def rollback(self, sql=None):
        """"""
        self._transaction = False
        try:
            rollback = self._con.rollback
        except AttributeError:
            return self._con.query(sql or 'rollback')
        else:
            if sql:
                return rollback(sql=sql)
            else:
                return rollback()
30763
def cancel(self):
        
        conn = self._assert_open()
        conn._try_activate_cursor(self)
        self._session.cancel_if_pending()
712989
function cancelBets() {
        // check request bets list
        var error;
        for ( var i = 0; i < req.request.bets.length; ++i) {
            var desc = req.request.bets[i];
            error = checkCancelBetItem(self, desc);
            // console.log('EMU bet', desc, "error", error);
            if (error)
                break;
        }
        if (error) {
            res.response.errorCode = 'MARKET_IDS_DONT_MATCH';
            cb(null, res);
            return;
        }

        // cancel bets
        res.response.errorCode = 'OK';
        res.response.betResults = [];
        for ( var i = 0; i < req.request.bets.length; ++i) {
            var betId = req.request.bets[i].betId;
            console.log('EMU: cancel id=', betId);
            var bet = self.bets[betId];

            // do cancel work
            var result = bet.cancel();

            var resItem = {
                betId : bet.betId,
                resultCode : result.code,
                sizeCancelled : result.sizeCancelled,
                sizeMatched : result.sizeMatched,
                success : result.success
            };

            res.response.betResults.push(resItem);
        }

        // cancelBets was OK
        cb(null, res);
    }
649144
def register
      response_request = Request.post("transactions/cancels", api_version, params)
      Response.new(response_request, self).serialize
    end
1112531
def cancel(self):
        
        if not self.__submitted:
            # XXX: Workaround for a bug reported on libusb 1.0.8: calling
            # libusb_cancel_transfer on a non-submitted transfer might
            # trigger a segfault.
            raise self.__USBErrorNotFound
        self.__mayRaiseUSBError(self.__libusb_cancel_transfer(self.__transfer))