Adding transaction listener wait around 5 mins to start next task

here is the loan provising process task" call recharge system" actually end with calling start new process in transaction context listener

Context.getTransactionContext().addTransactionListener(TransactionState.COMMITTED, commandContext -> {
processService.startLoanProvisioningProcess(processMessage);
});

the time take for transaction listner to finish around 5 mins can you please advise why this take a long time?
please note when we remove line transction commited listener it took normal time without waiting 5 mins
Some other notes
we disable history saving
and we are using postgress db with the following data source parameters

spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.minimum-idle=10
spring.datasource.hikari.maximum-pool-size=300
spring.datasource.hikari.idle-timeout=30000
spring.datasource.hikari.max-lifetime=1800000

Hey @gihan,

What are you doing in processService.startLoanProvisioningProcess(processMessage);? That is taking a lot of time to finish. This seems like your own piece of code. Doing it in TransactionState.COMMITTED is still doing it synchronous, but after the transaction has committed.

Cheers,
Filip

Hi @filiphr
Thanks alot for your reply
it start other async small proccess
runtimeService.startProcessInstanceByKey(mnoCode,"loanProvisioning- "+loanProvisioningTrigger.getLoanTriggerRequestId(),processVariables);

i think it get timeout for async task and then start to execute the small proccess

startProcessInstanceByKey is not async. Is your first service task async?

yes it the service tasks inside the proccess itself is asyn