This method removes the transaction.

@param txn The name of the transaction
760463
public void remove(String txn) {
        synchronized (filterMap) {
            // Check if old filter processor needs to be removed
            FilterProcessor oldfp = filterMap.get(txn);
            if (oldfp != null) {
                globalExclusionFilters.remove(oldfp);
                btxnFilters.remove(oldfp);
            }
        }
    }
1194573
final public void delete(Transaction t) {
		t.delete(Utils.getTableName(getClass()), Utils.getWhereStatement(this));
        t.addOnTransactionCommittedListener(new OnTransactionCommittedListener() {

            @Override
            public void onTransactionCommitted() {
                Sprinkles.sInstance.mContext.getContentResolver().notifyChange(
                        Utils.getNotificationUri(Model.this.getClass()), null);
            }
        });
		afterDelete();
	}
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);
        }
    }
913453
public void removeReader(TransactionImpl tx, Object obj)
	{
		try
		{
			LockEntry lock = new LockEntry(new Identity(obj,getBroker()).toString(), tx.getGUID());
            removeReaderRemote(lock);
		}
		catch (Throwable t)
		{
			log.error("Cannot remove LockEntry for object " + obj + " in transaction " + tx);
		}
	}
379139
public boolean delete(final T key) {
    try (Txn<T> txn = env.txnWrite()) {
      final boolean ret = delete(txn, key);
      txn.commit();
      return ret;
    }
  }
1231829
public static void addTxn(TransactionImpl txn)
    {
        if (tc.isEntryEnabled()) Tr.entry(tc, "addTxn", txn);

        final ByteArray key = new ByteArray(txn.getXid().getGlobalTransactionId());

        synchronized (txnTable)
        {
            if (!txnTable.containsKey(key))
            {
                txnTable.put(key, new JCATranWrapperImpl(txn, true, false)); // @LIDB2110C
            }
        }

        if (tc.isEntryEnabled()) Tr.exit(tc, "addTxn");
    }
757131
@Override
    public void terminateTransaction()
    {
        if (tmLog.isDebugEnabled()) {
            tmLog.debug("Aborting transaction: " + TxnEgo.txnIdToString(txnId));
        }
        FragmentTaskMessage dummy = new FragmentTaskMessage(0L, 0L, 0L, 0L, false, false, false,
                m_nPartTxn, m_restartTimestamp);
        FragmentResponseMessage poison = new FragmentResponseMessage(dummy, 0L);
        TransactionTerminationException termination = new TransactionTerminationException(
                "Transaction interrupted.", txnId);
        poison.setStatus(FragmentResponseMessage.TERMINATION, termination);
        offerReceivedFragmentResponse(poison);
     }
934185
public void delete() 
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "delete");
    
    

    // Mark the destination for deletion
    try
    {
      // Set the deletion flag in the DH persistently. A transaction per DH??
      LocalTransaction siTran = txManager.createLocalTransaction(true);

      setToBeDeleted(true);
      
      // Adjust the destination lookups in Destination Manager
      destinationManager.getLinkIndex().delete(this);
      
      requestUpdate((Transaction) siTran);
      // commit the transaction
      siTran.commit();
      
      String name = _mqLinkName;
      if (name == null)      
        name = getName();
      SibTr.info(tc, "MQLINK_DEST_DELETE_INFO_CWSIP0064", 
                   new Object[]{name, _mqLinkUuid});   
    }
    catch (MessageStoreException e)
    {
      // No FFDC code needed
      
      SibTr.exception(tc, e);
      
      //throw e;
    }
    catch (SIException e)
    {
      // No FFDC code needed
      
      SibTr.exception(tc, e);
       
      //handleRollback(siTran);
      //        throw e;
    }    

    // Now start the asynch deletion thread to tidy up
    destinationManager.startAsynchDeletion();
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "delete");        
  }
606867
public function delete(TransactionInterface $transaction = null)
    {
        if (empty($transaction)) {
            /*
             * When no transaction is given we will create our own and run it immediately.
             */
            $transaction = $transaction ?? new Transaction();
            $transaction->delete($this);
            $transaction->run();
        } else {
            $transaction->addCommand($this->queueDelete());
        }
    }
1258054
final public void delete() {
		Transaction t = new Transaction();
		try {
			delete(t);
			t.setSuccessful(true);
		} finally {
			t.finish();
		}
	}
664795
public static void deregisterTx(Session tx) {
        if (tx == null) {
            return;
        }
        synchronized (allFields) {
            for (TransientField<?> f: allFields.keySet()) {
                //returns null if key does not exist.
                synchronized (f) {
                    if (f.txMap.containsKey(tx)) {
                        f.txMap.remove(tx).clear();
                    }
                }
            }
        }
    }
618922
public void removeOngoingTransaction(Transaction transaction) {
		boolean removed = false;
		if(this.ongoingTransactions != null) {
			removed = this.ongoingTransactions.remove(transaction);
		}

//		if(sessionCreatingTransactionRequest != null && sessionCreatingTransactionRequest.getMessage() != null && JainSipUtils.DIALOG_CREATING_METHODS.contains(sessionCreatingTransactionRequest.getMethod())) {
//			sessionCreatingTransactionRequest = null;
//		}

		if (proxy != null) {
		    proxy.removeTransaction(transaction.getBranchId());
		}

		if(logger.isDebugEnabled()) {
			logger.debug("transaction "+ transaction +" has been removed from sip session's ongoingTransactions ? " + removed );
		}

		updateReadyToInvalidate(transaction);
		// nullify the sessionCreatingTransactionRequest only after updateReadyToInvalidate as it is used for error response checking

		final String branchId = transaction.getBranchId();
		if(sessionCreatingTransactionRequest != null &&
				 branchId != null) {

			// https://github.com/RestComm/sip-servlets/issues/101 fix for NPE happening due to concurrent behavior cleaning the transaction
			final Transaction sessionCreatingTransactionRequestTransaction = sessionCreatingTransactionRequest.getTransaction();
			String sessionCreatingTransactionRequestTransactionBranchId = null;
			if(sessionCreatingTransactionRequestTransaction != null) {
				sessionCreatingTransactionRequestTransactionBranchId = sessionCreatingTransactionRequestTransaction.getBranchId();
			}
			final String sessionCreatingTransactionRequestMethod = sessionCreatingTransactionRequest.getMethod();

			if(sessionCreatingTransactionRequestTransaction != null &&
					branchId.equals(sessionCreatingTransactionRequestTransactionBranchId)) {

				if(logger.isDebugEnabled()) {
					logger.debug("Session " + key + ": cleaning up "+ sessionCreatingTransactionRequest
							+ " since transaction " + transaction + " with branch id " + branchId
							+ " is the same as sessionCreatingRequestTransaction " +  sessionCreatingTransactionRequestTransaction
							+ " with branch id " + sessionCreatingTransactionRequestTransactionBranchId
							+ " and method " + sessionCreatingTransactionRequestMethod);
				}
				sessionCreatingTransactionRequest.cleanUp();
				// https://telestax.atlassian.net/browse/MSS-153 improve performance by cleaning the request for dialog based requests
				// or proxy case or dialog creating methods
				if(sessionCreatingDialog != null || proxy != null || JainSipUtils.DIALOG_CREATING_METHODS.contains(sessionCreatingTransactionRequestMethod)) {
					if(logger.isDebugEnabled()) {
						logger.debug("removeOngoingTransaction - sessionCreatingTransactionRequest=" + sessionCreatingTransactionRequest);
					}
					if(logger.isDebugEnabled() && sessionCreatingTransactionRequest != null) {
						logger.debug("nullifying  sessionCreatingTransactionRequest" + sessionCreatingTransactionRequest
								+ " from Session " + key);
					}
					if(logger.isDebugEnabled()) {
						logger.debug("invalidate - setting the sessionCreatingTransactionRequest to null, id:" + this.getId());
					}
					sessionCreatingTransactionRequest = null;
				}
			}
		}
	}
275452
@Override
    public void delete(Object entity, Object pKey)
    {
        s = getStatelessSession();
        Transaction tx = null;
        tx = onBegin();
        s.delete(entity);
        onCommit(tx);

        EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entity.getClass());
        MetamodelImpl metamodel = (MetamodelImpl) KunderaMetadataManager.getMetamodel(kunderaMetadata,
                metadata.getPersistenceUnit());
        if (!MetadataUtils.useSecondryIndex(getClientMetadata()))
        {
            getIndexManager().remove(metadata, entity, pKey);
        }
    }
327410
@Override
    protected void disconnectTransactions(StoredBlock oldBlock) throws PrunedException, BlockStoreException {
        checkState(lock.isHeldByCurrentThread());
        blockStore.beginDatabaseBatchWrite();
        try {
            StoredUndoableBlock undoBlock = blockStore.getUndoBlock(oldBlock.getHeader().getHash());
            if (undoBlock == null) throw new PrunedException(oldBlock.getHeader().getHash());
            TransactionOutputChanges txOutChanges = undoBlock.getTxOutChanges();
            for (UTXO out : txOutChanges.txOutsSpent)
                blockStore.addUnspentTransactionOutput(out);
            for (UTXO out : txOutChanges.txOutsCreated)
                blockStore.removeUnspentTransactionOutput(out);
        } catch (PrunedException e) {
            blockStore.abortDatabaseBatchWrite();
            throw e;
        } catch (BlockStoreException e) {
            blockStore.abortDatabaseBatchWrite();
            throw e;
        }
    }
446925
public void deleteCurrent(SITransaction transaction)
  throws SISessionUnavailableException, SISessionDroppedException,
         SIResourceException, SIConnectionLostException, SILimitExceededException,
         SIIncorrectCallException,
         SIErrorException, SIMPMessageNotLockedException
  {
    if (TraceComponent.isAnyTracingEnabled() && CoreSPILockedMessageEnumeration.tc.isEntryEnabled())
      SibTr.entry(CoreSPILockedMessageEnumeration.tc, "deleteCurrent",
        new Object[] {new Integer(hashCode()), transaction, this});

    checkValidState("deleteCurrent");

    localConsumerPoint.checkNotClosed();

    if (transaction != null && !((TransactionCommon)transaction).isAlive())
    {
      SIIncorrectCallException e = new SIIncorrectCallException( nls.getFormattedMessage(
        "TRANSACTION_DELETE_USAGE_ERROR_CWSIP0778",
           new Object[] { consumerSession.getDestinationAddress() },
           null) );

      if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
        SibTr.exception(tc, e);

      if (TraceComponent.isAnyTracingEnabled() && CoreSPILockedMessageEnumeration.tc.isEntryEnabled())
        SibTr.exit(CoreSPILockedMessageEnumeration.tc, "deleteCurrent", e);

      throw e;
    }

    JsMessageWrapper msg = null;
    boolean isStored = false;

    synchronized(this)
    {
      checkCurrentMessageAvailable((TransactionCommon) transaction);

      // Pull out the interesting bits of the message
      msg = currentMsg.message;
      isStored = currentMsg.isStored;

      //remove the message from the list
      removeMessage(currentMsg);

      // There is now no message under the cursor
      messageAvailable = false;
    } // synchronized


    if((msg != null))
    {
      // If the message was not recoverable (not on an itemStream) we've finished
      // Otherwise delete it from MS
      if (isStored)
      {
        removeMessageFromStore(msg,
                               (TransactionCommon) transaction,
                               true); // true = decrement active message count
      }
      else // !isStored
      {
        localConsumerPoint.removeActiveMessages(1);
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && CoreSPILockedMessageEnumeration.tc.isEntryEnabled())
      SibTr.exit(CoreSPILockedMessageEnumeration.tc, "deleteCurrent", this);
  }
1048019
private void onCleanup(Object connection)
    {
        // if not running within transaction boundary
        if (this.connection != null)
        {
            if (settings != null)
            {
                ((Jedis) connection).configResetStat();
            }
            factory.releaseConnection((Jedis) this.connection);
        }

        this.connection = null;
    }
1066474
@Override
	public void removeByC_S(long commerceOrderId, boolean subscription) {
		for (CommerceOrderItem commerceOrderItem : findByC_S(commerceOrderId,
				subscription, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceOrderItem);
		}
	}