See https://github.com/bitronix/btm/blob/1072c3042c8b65ecf17ded88115631e061f23333/btm/src/main/java/bitronix/tm/BitronixTransaction.java#L580
for reference.

@return whether the current transaction is done or not
342713
private boolean isDone()
   {
      switch (status) {
      case Status.STATUS_PREPARING:
      case Status.STATUS_PREPARED:
      case Status.STATUS_COMMITTING:
      case Status.STATUS_COMMITTED:
      case Status.STATUS_ROLLING_BACK:
      case Status.STATUS_ROLLEDBACK:
         return true;
      default:
         return false;
      }
   }
812773
public boolean isCurrent() {
        BaasUser current = current();
        if (current == null) return false;
        Logger.debug("Current username is %s and mine is %s", current.username, username);
        return current.username.equals(username);
    }
1229491
public function doneAnything()
    {
        $output = false;
        foreach( $this->status as $transaction => $transactionStatus ) {
            foreach( $transactionStatus as $status ) {
                $output = ( $output || $status === self::SUCCESS );
            }
        }
        return $output;
    }
395195
public int getStatus() {
        if (ptm == null) {
            return TransactionManager.STATUS_NO_TRANSACTION;
        }

        // logger.debug( "Current TX name (According to TransactionSynchronizationManager) : " + TransactionSynchronizationManager.getCurrentTransactionName() );
        if (TransactionSynchronizationManager.isActualTransactionActive()) {
            TransactionStatus transaction = null;
            boolean commitNewTransaction = false;
            try {
                if (currentTransaction.isEmpty()) {
                    transaction = ptm.getTransaction(td);
                    currentTransaction.push(transaction);
                    commitNewTransaction = true;
                    if (transaction.isNewTransaction()) {
                        return TransactionManager.STATUS_COMMITTED;
                    }
                } else {
                    transaction = currentTransaction.peek();
                }
                logger.debug("Current TX: " + transaction);
                // If SynchronizationManager thinks it has an active transaction but
                // our transaction is a new one
                // then we must be in the middle of committing
                if (transaction.isCompleted()) {
                    if (transaction.isRollbackOnly()) {
                        return TransactionManager.STATUS_ROLLEDBACK;
                    }
                    return TransactionManager.STATUS_COMMITTED;
                } else {
                    if (transaction.isRollbackOnly()) {
                        return 5;
                    }
                    return TransactionManager.STATUS_ACTIVE;
                }
            } finally {
                if (commitNewTransaction) {
                    ptm.commit(transaction);
                }
            }
        }
        return TransactionManager.STATUS_NO_TRANSACTION;
    }
765187
private boolean checkTickerFreshness() {
		final QuoteManager quoteManager = bitfinexApiBroker.getQuoteManager();
		final Map<BitfinexStreamSymbol, Long> heartbeatValues = quoteManager.getLastTickerActivity();

		return checkTickerFreshness(heartbeatValues);
	}
808090
public final boolean isOutCommitted()
  {
    OutHttpApp stream = out();
    
    if (stream.isCommitted()) {
      return true;
    }

    // server/05a7
    if (_contentLengthOut > 0 && _contentLengthOut <= stream.contentLength()) {
      return true;
    }

    return false;
  }
41108
def RemoveTransaction(self, tx):
        
        if BC.Default() is None:
            return False

        if not BC.Default().ContainsTransaction(tx.Hash):
            return False

        if tx.Hash.ToBytes() in self.MemPool:
            del self.MemPool[tx.Hash.ToBytes()]
            return True

        return False
956575
public boolean isGlobalTxActive()
   {
      TransactionContext ctx;
      try
      {
         // We need to check the status also to be able to manage properly suspend and resume
         return (ctx = contexts.get()) != null && ctx.getXidContext() != null && tm.getStatus() != Status.STATUS_NO_TRANSACTION;
      }
      catch (SystemException e)
      {
         log.warn("Could not check if a global Tx has been started", e);
      }
      return false;
   }
1323985
@Override
    public void batchPrecommit(TransactionCommon currentTran)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "batchPrecommit", currentTran);
        try
        {
            persistCompletedPrefix(currentTran);
        } catch (SIResourceException e)
        {
            //FFDC
            FFDCFilter.processException(
                                        e,
                                        "com.ibm.ws.sib.processor.gd.GuaranteedTargetStream.batchPrecommit",
                                        "1:1911:1.110",
                                        this);

            SibTr.exception(tc, e);

            //TODO don't know what to do here - rethrow?!
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "batchPrecommit");
    }
542151
public boolean getRollbackOnly()
    {
        LocalTransactionCoordinator lCoord = getLocalCoord();
        if (lCoord != null) {
            return (lCoord.getRollbackOnly());
        } else {

            int status = Status.STATUS_NO_TRANSACTION; //LIDB1673.2.1.5
            try { //LIDB1673.2.1.5
                status = txService.getStatus(); //LIDB1673.2.1.5
            } //LIDB1673.2.1.5
            catch (SystemException e) //LIDB1673.2.1.5
            { //LIDB1673.2.1.5
                FFDCFilter.processException(e, CLASS_NAME + ".getRollbackOnly",
                                            "667", this); //LIDB1673.2.1.5
            } //LIDB1673.2.1.5
            return (status == Status.STATUS_MARKED_ROLLBACK || //LIDB1673.2.1.5
                    status == Status.STATUS_ROLLEDBACK || //LIDB1673.2.1.5
            status == Status.STATUS_ROLLING_BACK); //LIDB1673.2.1.5

        }
    }
860753
private function isInTransaction()
    {
        $poolName = $this->poolName;
        if(null === $poolName)
        {
            $poolName = Db::getDefaultPoolName();
        }
        if(PoolManager::hasRequestContextResource($poolName))
        {
            $resource = PoolManager::getRequestContextResource($poolName);
            $db = $resource->getInstance();
            return $db->inTransaction();
        }
        else
        {
            return false;
        }
    }
97620
int getAndResetCommitCount() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getAndResetCommitCount");
        int currentUncommittedReceiveCount = uncommittedReceiveCount;
        uncommittedReceiveCount = 0;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getAndResetCommitCount", currentUncommittedReceiveCount);
        return currentUncommittedReceiveCount;
    }
136948
public final boolean isGlobalTransactionActive() {
        UOWCurrent uow = (UOWCurrent) mcf.connectorSvc.getTransactionManager();
        UOWCoordinator coord = uow == null ? null : uow.getUOWCoord();
        return coord != null && coord.isGlobal();
    }
1334652
@Override
	public void commit() {
		Optional<LocalTransactionContext> txContext = currentTxContext();
		if (txContext.isPresent()) {
			txContext.get().commit();
		} else {
			this.unmanagedTransaction.ifPresent(LocalTransactionContext::commit);
		}
	}
809576
public static boolean isCommittedProcessed(byte[] stateBytes, Transaction tx) {
    long writePointer = Bytes.toLong(stateBytes, 0, Longs.BYTES);
    if (!tx.isVisible(writePointer)) {
      return false;
    }
    byte state = stateBytes[Longs.BYTES + Ints.BYTES];
    return state == ConsumerEntryState.PROCESSED.getState();
  }
444602
protected static boolean globalTranExists()
    {
        if (tc.isEntryEnabled()) Tr.entry(tc, "globalTranExists");

        boolean retval = false;

        try
        {
            if (_currentTM != null)
                retval = _currentTM.getTransaction() != null;
        }
        catch (SystemException se)
        {
            // No FFDC needed as our implementation will never throw exception
        }

        if (tc.isEntryEnabled()) Tr.exit(tc, "globalTranExists", retval);
        return retval;
    }
606908
public final int getTransactionType()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            SibTr.entry(this, tc, "getTransactionType");
            SibTr.exit(this, tc, "getTransactionType", "return=TX_GLOBAL");
        }
        return TX_GLOBAL;
    }