Is it single transaction to create a "process instance"?

Hi Camunda,

Is it single transaction to create a “process instance”?
I know that wait state is transaction boundaries.
When a “process instance” instantiating a “process definition” for an object is created (startProcessInstanceByKey Java API), I want to know if that time is considered a single transaction.

Regards,
Choi

Hi @H_C,

yes.

Hope this helps, Ingo

Hi @Ingo_Richtsmeier,
Thank you for your reply.
However, if an error occurs during " `startProcessInstanceByKey", it is said that it is not recorded in the runtime database.
(Transactions in Processes | docs.camunda.org)
It’s a single transaction, but does it mean you roll back on exception occurs?
And can I change the create of process instance to not set it as a transaction?
I would like to set it as one transaction if I am doing an instance without wait state.
According to your reply, is there two transactions(create instance, finish instance(?)) for an instance without a wait state?

Regards,
Choi

Hi @H_C,

yes

no

No. Only wait states will be commited (or rolled back in case of exceptions). You can create wait states with async before or async after, but not anywhere else.

Hope this helps, Ingo

Hi @Ingo_Richtsmeier,

Thank you for your reply.
That means “startProcessInstanceByKey” is a single transaction, but it doesn’t commit.
Is it right?

So, is the transaction context held in memory until the wait state?
If there is no wait state, does the transaction context never commit?
Is the context not committed even when the instance execution is finished?

Regards,
Choi

Hi @H_C,

If it fails, yes. If it doesn’t fail in a process without wait states, the transaction is commited when the process instance ends.

Yes.

No. The last (and maybe only) transaction boundary is the end of the process.

If the process instance ends (successfully), the data are commited into the history tables.

Hope this helps, Ingo