Is a transaction associated with a target object for transaction manager?

@return <i>true</i> if a transaction associated, otherwise <i>false</i>
@throws EFapsException if the status of the transaction manager could not
be evaluated
@see #TRANSMANAG
357361
public static boolean isTMNoTransaction()
        throws EFapsException
    {
        try {
            return Context.TRANSMANAG.getStatus() == Status.STATUS_NO_TRANSACTION;
        } catch (final SystemException e) {
            throw new EFapsException(Context.class, "isTMNoTransaction.SystemException", e);
        }
    }
24126
@Override
    public boolean isCorruptOrIndoubt()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "isCorruptOrIndoubt");

        boolean isCorruptOrIndoubt = _targetDestinationHandler.isCorruptOrIndoubt();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "isCorruptOrIndoubt", Boolean.valueOf(isCorruptOrIndoubt));

        return isCorruptOrIndoubt;
    }
1290910
@Override
    public boolean isTransacted()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            SibTr.entry(this, tc, "isTransacted");
            SibTr.exit(this, tc, "isTransacted", Boolean.valueOf(transacted));
        }
        return transacted;
    }
207805
boolean transitionToStickyGlobalTran(BeanId beanId,
                                         ContainerTx currentTx,
                                         ContainerTx expectedTx) {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "transitionToStickyGlobalTran (" + beanId +
                         "," + currentTx + ", " + expectedTx + ")");

        ContainerTx resumedTx = null;
        EJSDeployedSupport s = getMethodContext();
        EJBMethodInfoImpl methodInfo = s.methodInfo;
        BeanMetaData bmd = beanId.getBeanMetaData();

        try {
            // -----------------------------------------------------------------------
            // First, complete the local transaction that was started early in
            // preInvoke with the normal postInvoke processing.
            // -----------------------------------------------------------------------
            currentTx.postInvoke(s);
            uowCtrl.postInvoke(beanId, s.uowCookie, s.exType, methodInfo);

            // Clear to insure postInvoke we occur again if there are failures below.
            s.uowCtrlPreInvoked = false;
            s.currentTx = null;

            if (isTraceOn && tc.isDebugEnabled())
                Tr.debug(tc, "transitionToStickyGlobalTran : local tx completed");

            // -----------------------------------------------------------------------
            // Next, resume the sticky global transaction by executing the same
            // code that would normally happen early in preInvoke.
            // -----------------------------------------------------------------------

            s.uowCookie = uowCtrl.preInvoke(beanId, methodInfo);
            s.uowCtrlPreInvoked = true;

            if (isTraceOn && tc.isDebugEnabled())
                Tr.debug(tc, "transitionToStickyGlobalTran : sticky global resumed");

            // Get the Container Transaction object (ContainerTx) associated
            // with the current transaction, as returned in the UOW Cookie
            // on UOW preInvoke.
            boolean isLocal = s.uowCookie.isLocalTx();
            SynchronizationRegistryUOWScope UOWid = s.uowCookie.getTransactionalUOW();
            resumedTx = getCurrentTx(UOWid, isLocal);

            s.currentTx = resumedTx;
            resumedTx.preInvoke(s);

            // -----------------------------------------------------------------------
            // Now complete the rest of the transaction processing that normally
            // occurs in preInvoke.
            // -----------------------------------------------------------------------

            int isolationLevel = methodInfo.isolationAttr;
            if (bmd.ivModuleVersion <= BeanMetaData.J2EE_EJB_VERSION_1_1 ||
                (bmd.ivModuleVersion >= BeanMetaData.J2EE_EJB_VERSION_2_0 &&
                 bmd.cmpVersion == InternalConstants.CMP_VERSION_1_X)) {
                resumedTx.setIsolationLevel(isolationLevel);
            }
            s.currentIsolationLevel = isolationLevel;
        } catch (RemoteException rex) {
            FFDCFilter.processException(rex, CLASS_NAME + ".getBean", "1542", this);

            // Something very unexpected, and ugly happened. Report this as an
            // EJBException, which will cause bean activation to fail. The method
            // context should be in an appropriate state that postInvoke will be
            // able to cleanup properly.
            throw ExceptionUtil.EJBException("A failure occured resuming a bean managed transaction", rex);
        }

        // -----------------------------------------------------------------------
        // Return true only if expected 'sticky' transaction was indeed resumed.
        // It is possible that a different thread resumed the sticky transaction
        // first, so this thread will still just have a local transaction and
        // should continue to wait to lock the bean; false is returned.  d671368.1
        // -----------------------------------------------------------------------

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "transitionToStickyGlobalTran : " + (resumedTx == expectedTx));

        return resumedTx == expectedTx;
    }
120406
@Override
    public boolean isTransactionActive() {

        if (this.getTransactionManager() != null)
            try {
                if (this.getTransactionManager().getStatus() == Status.STATUS_ACTIVE)
                    return true;

            } catch (SystemException se) {
                if (TC.isDebugEnabled()) {
                    Tr.debug(TC, "Returning isTransactionActive() false: " + se.getMessage());
                }
                return false;
            }
        return false;
    }
985439
protected boolean involvedInTransaction() {

        final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled();

        if (state == STATE_TRAN_WRAPPER_INUSE) {

            if (isTracingEnabled && tc.isDebugEnabled()) {
                Tr.debug(this, tc, "involvedInTransaction: true");
            }

            return true;
        } else {

            if (isTracingEnabled && tc.isDebugEnabled()) {
                Tr.debug(this, tc, "involvedInTransaction: false");
            }

            return false;
        }

    }
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;
    }
220242
private int runTransactionalAssignment(final TargetFilterQuery targetFilterQuery, final Long dsId) {
        final String actionMessage = String.format(ACTION_MESSAGE, targetFilterQuery.getName());

        return DeploymentHelper.runInNewTransaction(transactionManager, "autoAssignDSToTargets",
                Isolation.READ_COMMITTED.value(), status -> {
                    final List<TargetWithActionType> targets = getTargetsWithActionType(targetFilterQuery.getQuery(),
                            dsId, targetFilterQuery.getAutoAssignActionType(), PAGE_SIZE);
                    final int count = targets.size();
                    if (count > 0) {
                        deploymentManagement.assignDistributionSet(dsId, targets, actionMessage);
                    }
                    return count;
                });
    }
1181379
public final boolean isTransactional() {
        // Take a snapshot of the value with first use (or reuse from pool) of the managed connection.
        // This value will be cleared when the managed connection is returned to the pool.
        if (transactional == null) {
            transactional = mcf.dsConfig.get().transactional;
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(this, tc, "transactional=", transactional);
        }

        return transactional;
    }
251596
public static boolean isUncommitted(Transaction tx)
   {
      if (tx == null)
         return false;
      
      try
      {
         int status = tx.getStatus();

         return status == Status.STATUS_ACTIVE || status == Status.STATUS_MARKED_ROLLBACK;
      }
      catch (SystemException error)
      {
         throw new RuntimeException("Error during isUncommitted()", error);
      }
   }
279023
public PlatformTransactionManager getPlatformTransactionManager() {
        if (transactionManager != null) {
            return transactionManager;
        }
        transactionManager = (PlatformTransactionManager) ContainerManager.getComponent("transactionManager");
        return transactionManager;
    }
560150
private final void complete(boolean reUse,
                                Transaction transaction)
                    throws ObjectManagerException {
        final String methodName = "complete";
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass, methodName, new Object[] { new Boolean(reUse),
                                                                transaction });

        // No longer any need to include this transaction in a Checkpoint.
        requiresPersistentCheckpoint = false;
        // Clear any remaining state.
        logicalUnitOfWork.XID = null;
        transactionLock = new TransactionLock(this);
        includedManagedObjects.clear();
        callbackTokens.clear();
        allPersistentTokensToNotify.clear();
        loggedSerializedBytes.clear();
        logSequenceNumbers.clear();
        managedObjectSequenceNumbers.clear();
        useCount++;

        if (reUse) { // Reset the transaction for further use.
            // Note that we do not clear the transactionReference because the caller is still holding it.
            // If the caller releases his reference then the reference will be found by ObjectManagerState
            // and this InternalTransaction may be reused for another external Transaction.

        } else { // Do not chain.
            // Make sure the external Transaction cannot reach this internal one.
            transaction.internalTransaction = objectManagerState.dummyInternalTransaction;
            // This may not be sufficient to prevent its being used if the external Transaction already has passed
            // the point where it has picked up the referenece to the Internaltransaction. Hence we terminate the
            // InternalTransaction if it is preemptively backed out. See ObjectManagerstate.performCheckpoint()
            // where transactions are backed out without holding the internal transaction synchronize lock.
            if (transactionReference != null)
                transactionReference.clear(); // Inhibt an enqueue of the transactionReference.
            // If a reference is enqueued we are already in inactive state for this
            // transactionReferenceSequence so no action will occur.

            // Tell the ObjectManager that we no longer exist as an active transaction.
            objectManagerState.deRegisterTransaction(this);

        } // if (reUse).

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass, methodName);
    }
608754
public final boolean isAutoCommit()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            SibTr.entry(this, tc, "isAutoCommit");
            SibTr.exit(this, tc, "isAutoCommit", "return=false");
        }
        return false;
    }
985497
public boolean isMine(TransactionBag transactionBag) {
        try {
            Script script = getScriptPubKey();
            if (ScriptPattern.isP2PK(script))
                return transactionBag.isPubKeyMine(ScriptPattern.extractKeyFromP2PK(script));
            else if (ScriptPattern.isP2SH(script))
                return transactionBag.isPayToScriptHashMine(ScriptPattern.extractHashFromP2SH(script));
            else if (ScriptPattern.isP2PKH(script))
                return transactionBag.isPubKeyHashMine(ScriptPattern.extractHashFromP2PKH(script),
                        Script.ScriptType.P2PKH);
            else if (ScriptPattern.isP2WPKH(script))
                return transactionBag.isPubKeyHashMine(ScriptPattern.extractHashFromP2WH(script),
                        Script.ScriptType.P2WPKH);
            else
                return false;
        } catch (ScriptException e) {
            // Just means we didn't understand the output of this transaction: ignore it.
            log.debug("Could not parse tx {} output script: {}",
                    parent != null ? ((Transaction) parent).getTxId() : "(no parent)", e.toString());
            return false;
        }
    }
1359925
public boolean isTooMany() {

        return (m_tooManyCount != null)
            || ((m_workflowResources != null)
                && (m_workflowResources.size() > OpenCms.getWorkflowManager().getResourceLimit()));
    }
804008
public static boolean isPackageInstalled(Context context, String targetPackage) {
        PackageManager manager = context.getPackageManager();
        Intent intent = new Intent();
        intent.setPackage(targetPackage);
        return manager.resolveActivity(intent, 0) != null;
    }
699446
public function commitTransaction() : bool
    {
        $result = @$this->getConnection()->exec('COMMIT TRANSACTION');

        if ($result === false) {
            throw new ParserRuntimeException('Transaction could not be committed.', 0);
        }

        return $result;
    }