the process is executed as a sequence of commands which are executed by the proces engine. Commands either result from API calls or from the Job Executor doing async continuation or timers.
In each command, the process engine will open a session in MyBatis. This leads to a connection being requested from the pool.
=> connections are checked out from the pool for the duration of a command.
This is as far as the process engine is concerned. If you use an external transaction manager (Spring or JTA) to scope transactions a transaction may also span two commands. Example (Spring):
@Transactional
public void doSomething() {
runtimeService.startProcessInstance()
taskService.complete()
}
In that case the connection will be used for the two commands.
Only if an individual transaction within the process takes a long time.
2 Questions:
1) Which connection pool are you usign?
2) Are you using org.camunda.bpm.engine.impl.persistence.StrongUuidGenerator ?
Cheers,
Daniel