Execute action in new transaction?

0
In transaction 1 I change some objects and create a QueuedAction to further process these objects. I guess that this QueuedAction is executed in a new transaction 2. Can I be sure that all changes of transaction 1 are available when transaction 2 is started? What is the trigger for the QueuedAction to be executed? If this is the 'AppendToQueue'-action then transaction 2 is triggered before transaction 1 is finished, and I would think that not all (changes to) data may be available in transaction 2.
asked
2 answers
1

If needed run your microflow from a java action using the IContext.startTransaction and endTransaction methods. If you use the sequence: - startTransaction - Core.executeAction(MF) - endTransaction

The microflow actions executed will be stored in the database and will be available in the next step of your microflow. Be aware that running a microflow like this will no longer allow rollback of the data committed in the microflow executed in the java action. So if the subsequent steps in the MF from where you trigger the java action result in an error the data created/changed or deleted by the java action will remain in tact.

answered
0

In my experience the QueuedAction takes a few seconds before it is started, so it depends on how "heavy" transaction 1 is if they will be available in transaction 2. I would say that it is not 100% guaranteed that transaction 1 will be finished and therefore not a dependable solution.

What the specific trigger is I don't know, it might be that instantiating the QueuedAction is the trigger?

answered