If the action is valid return null. Otherwise return a
TransactionException with the cause.

@param newAction
int
@return TransactionException
559211
public final ResourceException isValid(int newAction) {
        try {
            setState(newAction, true);
        } catch (TransactionException exp) {
            FFDCFilter.processException(exp, "com.ibm.ws.rsadapter.spi.WSStateManager.isValid", "385", this);
            return exp;
        }

        return null;
    }
911480
private J2EETransactionImpl newInternTransaction()
    {
        if (log.isDebugEnabled()) log.debug("obtain new intern odmg-transaction");
        J2EETransactionImpl tx = new J2EETransactionImpl(this);
        try
        {
            getConfigurator().configure(tx);
        }
        catch (ConfigurationException e)
        {
            throw new OJBRuntimeException("Cannot create new intern odmg transaction", e);
        }
        return tx;
    }
1223065
private PluginException createChainedException(String action, Throwable newException,
                                                   PluginException previousException) {
        String msg = action + " event generated an error.";
        log.error(msg, newException);
        PluginException wrapper = new PluginException(msg, previousException == null ? newException : previousException,
                null);
        wrapper.setStackTrace(newException.getStackTrace());
        return wrapper;
    }
578420
@Override
	public int getStatus() throws TransactionManagementException {
		logger.entering(CLASSNAME, "getStatus");
		int status = 0;
		
		try {
			status = userTran.getStatus();
			logger.log(Level.FINE, "javax.transaction.Status: {0}", status);
		} catch (SystemException e) {
			throw new TransactionManagementException(e);
		}
		logger.exiting(CLASSNAME, "getStatus", status);
		return status;
	}
822387
public Interval newInterval (final Runnable action)
    {
        return new Interval(this) {
            @Override public void expired () {
                action.run();
            }

            @Override public String toString () {
                return "DObjectManagerInterval(" + action + ")";
            }

            @Override protected void noteRejected () {
                // don't complain
            }
        };
    }
1175169
public Transaction getTransaction() {
        try {
            return getTransactionManager().getTransaction();
        }
        catch (Exception ex) {
            StandardLogger logger = LoggerUtil.getStandardLogger();
            logger.severeException(ex.getMessage(), ex);
            return null;
        }
    }
186992
public void addCommitAction(final Runnable action) throws HibernateException
	{
		if (action == null)
			return; // ignore null actions

		addAction(new BaseSessionEventListener()
		{
			@Override
			public void transactionCompletion(final boolean successful)
			{
				if (successful)
					action.run();
			}
		});
	}
863413
public <T> T doAs(PrivilegedAction<T> action) {
    return Subject.doAs(null, action);
  }
866691
public Wait action(TestAction action) {
        if (action instanceof TestActionBuilder) {
            getCondition().setAction(((TestActionBuilder) action).build());
            this.action.setAction(((TestActionBuilder) action).build());
            getBuilder().actions(((TestActionBuilder) action).build());
        } else {
            getCondition().setAction(action);
            this.action.setAction(action);
            getBuilder().actions(action);
        }

        return getBuilder().build();
    }
458507
public static FuncN<Void> fromAction(final Action0 f) {
        return new FuncN<Void>() {

            @Override
            public Void call(Object... args) {
                if (args.length != 0) {
                    throw new RuntimeException("Action0 expecting 0 arguments.");
                }
                f.call();
                return null;
            }

        };
    }
1155863
public static TransactionException transactionClosed(@Nullable TransactionOLTP tx, @Nullable String reason) {
        if (reason == null) {
            Preconditions.checkNotNull(tx);
            return create(ErrorMessage.TX_CLOSED.getMessage(tx.keyspace()));
        } else {
            return create(reason);
        }
    }
265202
public Api getActionResult(String action, String params) throws Exception {
    Api result = this.getActionResult(action, params, null, null);
    return result;
  }
977503
@POST
    public Response createTransaction(@PathParam("path") final String externalPath) throws URISyntaxException {

        if (batchService.exists(session.getId(), getUserPrincipal())) {
            LOGGER.debug("renewing transaction {}", session.getId());
            batchService.refresh(session.getId(), getUserPrincipal());
            final Response.ResponseBuilder res = noContent();
            session.getFedoraSession().getExpires().ifPresent(expires -> {
                res.expires(from(expires));
            });
            return res.build();
        }

        if (externalPath != null && !externalPath.isEmpty()) {
            return status(BAD_REQUEST).build();
        }

        batchService.begin(session.getFedoraSession(), getUserPrincipal());
        session.makeBatchSession();
        LOGGER.info("Created transaction '{}'", session.getId());

        final Response.ResponseBuilder res = created(
                new URI(translator().toDomain("/tx:" + session.getId()).toString()));
        session.getFedoraSession().getExpires().ifPresent(expires -> {
            res.expires(from(expires));
        });
        return res.build();
    }
1159380
public void initQuitAction(QuitAction quitAction)
    {
        if (quitAction == null)
            throw new IllegalArgumentException("quitAction is null");
        if (this.quitAction != null)
            throw new IllegalArgumentException("The method is once-call.");

        this.quitAction = quitAction;
    }
582862
public ClientTransaction getNewClientTransaction(Request request)
			throws TransactionUnavailableException {
		
		checkState();
		final SIPClientTransaction ct = (SIPClientTransaction) provider.getNewClientTransaction(request);
		final ClientTransactionWrapper ctw = new ClientTransactionWrapper(ct,
				ra);
		ctw.setActivity(true);

		final DialogWrapper dw = ctw.getDialogWrapper();
		if (dw != null) {
			dw.addOngoingTransaction(ctw);
		}

		if (!ra.addSuspendedActivity(ctw)) {
			throw new TransactionUnavailableException(
					"Failed to create activity");
		}

		return ctw;
	}
652300
@Override
  public ActionRequestValidationException validate() {
    ActionRequestValidationException validationException = super.validate();
    if (termsEncoding != null && termsEncoding.equals(TermsEncoding.BYTES)) {
      if (maxTermsPerShard == null) {
        validationException = ValidateActions.addValidationError("maxTermsPerShard not specified for terms encoding [bytes]", validationException);
      }
    }
    return validationException;
  }
871739
public ActionState createActionState(final Flow flow, final String name, final String action) {
        return createActionState(flow, name, createEvaluateAction(action));
    }