Register an action to run on the successful commit of the transaction

@param action

@throws HibernateException
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();
			}
		});
	}
820907
private static IAction createAction(String action) {
        IAction actn = null;
        
        if (!StringUtils.isEmpty(action)) {
            if ((actn = ActionRegistry.getRegisteredAction(action)) == null) {
                actn = ActionUtil.createAction(null, action);
            }
        }
        
        return actn;
    }
480653
public void addActionResult(ActionResult actionResult) {
        ActionResult existActionResult = getActionResult(actionResult.getActionId());
        if (existActionResult != null &&
                existActionResult.getResultValue() instanceof ResultValueMap &&
                actionResult.getResultValue() instanceof ResultValueMap) {
            ResultValueMap resultValueMap = (ResultValueMap)existActionResult.getResultValue();
            resultValueMap.putAll((ResultValueMap)actionResult.getResultValue());
        } else {
            add(actionResult);
        }
    }
1056307
protected void executeAdvice(Executable action) {
        if (log.isDebugEnabled()) {
            log.debug("Action " + action);
        }

        try {
            action.execute(this);
        } catch (Exception e) {
            setRaisedException(e);
            throw new ActionExecutionException("Failed to execute advice action " + action, e);
        }
    }
951185
public void setAction(String action) throws ApplicationException {
	action = action.toLowerCase().trim();
	if (action.equals("get")) this.action = GET;
	else if (action.equals("put")) this.action = PUT;

	else if (action.equals("cache")) this.action = CACHE;
	else if (action.equals("clientcache")) this.action = CACHE_CLIENT;
	else if (action.equals("servercache")) this.action = CACHE_SERVER;
	else if (action.equals("flush")) this.action = FLUSH;
	else if (action.equals("optimal")) this.action = CACHE;

	else if (action.equals("client-cache")) this.action = CACHE_CLIENT;
	else if (action.equals("client_cache")) this.action = CACHE_CLIENT;

	else if (action.equals("server-cache")) this.action = CACHE_SERVER;
	else if (action.equals("server_cache")) this.action = CACHE_SERVER;

	else if (action.equals("content")) this.action = CONTENT;
	else if (action.equals("content_cache")) this.action = CONTENT;
	else if (action.equals("contentcache")) this.action = CONTENT;
	else if (action.equals("content-cache")) this.action = CONTENT;
	else throw new ApplicationException("invalid value for attribute action for tag cache [" + action + "], "
		+ "valid actions are [get,put,cache, clientcache, servercache, flush, optimal, contentcache]");

	// get: get an object from the cache.
	// put: Add an object to the cache.

    }
98061
public void commit() throws DBException
    {
        if (DBConstants.FALSE.equalsIgnoreCase(this.getProperty(SQLParams.AUTO_COMMIT_PARAM)))
        {
            if (!(this.getDatabaseOwner() instanceof RecordOwner))
                throw new DatabaseException("Transactions requires DB RecordOwnership");
        }
        else
            throw new DatabaseException("Auto-commit enabled");
    }
841956
protected <T extends DObject> void doSubscribe (ObjectAction<T> action)
    {
        // Log.info("doSubscribe: " + oid + ": " + target);

        int oid = action.oid;
        Subscriber<T> target = action.target;

        // first see if we've already got the object in our table
        @SuppressWarnings("unchecked") T obj = (T)_ocache.get(oid);
        if (obj != null) {
            // clear the object out of the flush table if it's in there
            if (_flushes.remove(oid) != null) {
//                 Log.info("Resurrected " + oid + ".");
            }
            // add the subscriber and call them back straight away
            obj.addSubscriber(target);
            target.objectAvailable(obj);
            return;
        }

        // see if we've already got an outstanding request for this object
        @SuppressWarnings("unchecked") PendingRequest<T> req = (PendingRequest<T>)_penders.get(oid);
        if (req != null) {
            // add this subscriber to the list to be notified when the request is satisfied
            req.addTarget(target);
            return;
        }

        // otherwise we need to create a new request
        req = new PendingRequest<T>(oid);
        req.addTarget(target);
        _penders.put(oid, req);
        // Log.info("Registering pending request [oid=" + oid + "].");

        // and issue a request to get things rolling
        _comm.postMessage(new SubscribeRequest(oid));
    }
25892
protected void executeAction(Action action) {
        ProcessContext context = new ProcessContext(getProcessInstance().getKnowledgeRuntime());
        context.setNodeInstance(this);
        try {
            action.execute(context);
        } catch (Exception e) {
            String exceptionName = e.getClass().getName();
            ExceptionScopeInstance exceptionScopeInstance = (ExceptionScopeInstance)
                resolveContextInstance(ExceptionScope.EXCEPTION_SCOPE, exceptionName);
            if (exceptionScopeInstance == null) {
                throw new WorkflowRuntimeException(this, getProcessInstance(), "Unable to execute Action: " + e.getMessage(), e);
            }
            
            exceptionScopeInstance.handleException(exceptionName, e);
            cancel();
        }
    }
489820
public void commit(boolean force) {
        if (checkSession()) {
            return;
        }

        if (log.isDebugEnabled()) {
            ToStringBuilder tsb = new ToStringBuilder(String.format("Committing transactional %s@%x",
                    sqlSession.getClass().getSimpleName(),sqlSession.hashCode()));
            tsb.append("force", force);
            log.debug(tsb.toString());
        }

        sqlSession.commit(force);
    }
217221
def register(action):
        
        if isinstance(action, str):
            Action.register(Action(action))
        elif isinstance(action, Action):
            Action.registered.add(action)
        else:
            for a in action:
                Action.register(a)
404164
public final void commit(final PersistentTransaction transaction) throws SevereMessageStoreException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "commit", "Transaction=" + transaction);

        if (STATE_END_PRECOMMIT == _state)
        {
            // normal processing
        }
        else
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())  SibTr.exit(tc, "commit");
            throw new TaskListException(_state);
        }

        _state = STATE_BEGIN_COMMIT;

        Task task = _firstTask;
        while (null != task)
        {
            task.commitInternal(transaction);
            task = task._nextTask;
        }

        task = _firstTask;
        while (null != task)
        {
            task.commitExternal(transaction);
            task = task._nextTask;
        }

        _state = STATE_END_COMMIT;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())  SibTr.exit(tc, "commit");
    }
862556
def _add_action(self, action):
        
        kwargs = self._get_method_params()

        kwargs['action'] = action

        self._bulk_actions.append(kwargs)
879879
@Override
    public synchronized void commit(boolean chain) {

//        tempActionHistory.add("commit " + actionTimestamp);
        if (isClosed) {
            return;
        }

        if (!isTransaction) {
            isReadOnly    = isReadOnlyDefault;
            isolationMode = isolationModeDefault;

            return;
        }

        if (!database.txManager.commitTransaction(this)) {

//            tempActionHistory.add("commit aborts " + actionTimestamp);
            rollback(false);

            throw Error.error(ErrorCode.X_40001);
        }

        endTransaction(true);
    }
425202
public void commit() throws HandlerException {
        if (_isInitiator) {
            try {
                _userTx.commit();
            } catch (SystemException se) {
                throw CommonKnowledgeMessages.MESSAGES.userTransactionCommitFailedSystem(se);
            } catch (HeuristicRollbackException hre) {
                throw CommonKnowledgeMessages.MESSAGES.userTransactionCommitFailedRollback(hre);
            } catch (HeuristicMixedException hme) {
                throw CommonKnowledgeMessages.MESSAGES.userTransactionCommitFailedMixed(hme);
            } catch (RollbackException re) {
                throw CommonKnowledgeMessages.MESSAGES.userTransactionCommitFailed(re);
            }
        }
    }
1357022
public function addIntendedAction($action)
    {
        if (empty($this->current_node->type) || $this->current_node->type == 'welcome') {
            return;
        }

        // If it's ->then() intended action. We'll save next action as id
        if (is_callable($action)) {
            $related = $this->current_node;

            $then_node = $this->persistNode([
                [
                    'type'    => 'callback',
                    'content' => $action,
                ],
            ], 'intended', 'IA#' . $related->id);

            $related->wait = $then_node->id;

            $related->save();
        } else {
            $this->current_node->wait = $action;

            $this->current_node->save();
        }
    }
630102
public void act(ActionExec action, List<ActionExec> feedback) {
        if (!isRunning())
            return;
        if (this.getSimulation() == null)
            return;

        boolean result = false;

        Structure actionStructure = action.getActionTerm();
        String actionID = actionStructure.getFunctor();

        try {
            if (this.actions.containsKey(actionID)) {

                Constructor<? extends JasonShanksAgentAction> c = this.actions
                        .get(actionID).getConstructor(
                                new Class[] { String.class, Steppable.class });

                JasonShanksAgentAction shanksAction = c.newInstance(
                        this.getID(), this, this.getLogger());

                result = shanksAction.executeAction(this.getSimulation(), this,
                        actionStructure.getTerms());
            } else {
                throw new UnknownShanksAgentActionException(actionID,
                        this.getID());
            }

        } catch (UnknownShanksAgentActionException e) {
            logger.severe("Action was not executed -> " + e.getMessage());
            e.printStackTrace();
        } catch (InstantiationException e) {
            logger.severe("InstantiationException" + e.getMessage());
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            logger.severe("IllegalAccessException" + e.getMessage());
            e.printStackTrace();
        } catch (SecurityException e) {
            logger.severe("SecurityException" + e.getMessage());
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            logger.severe("NoSuchMethodException" + e.getMessage());
            e.printStackTrace();
        } catch (IllegalArgumentException e) {
            logger.severe("IllegalArgumentException" + e.getMessage());
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            logger.severe("InvocationTargetException" + e.getMessage());
            e.printStackTrace();
        }

        action.setResult(result);
        this.getTS().getC().addFeedbackAction(action);
    }
679256
synchronized void prepareCommit(Session session) {

        RowActionBase action = this;

        do {
            if (action.session == session && action.commitTimestamp == 0) {
                action.prepared = true;
            }

            action = action.next;
        } while (action != null);
    }