The issue I am facing is, the database operations I am performing in the Service Task classes (using Spring Data JPA) is not getting committed until the whole process is completed. Some times I am even not seeing the data committed to transnational database.
Following are the things I have tried but did not work:
1. Annotated the service method with @Transactional(propagation = Propagation.REQUIRES_NEW)
Wondering if it is because you have a transaction that spans two databases. I had strange behaviour in V5.22 when I indirectly had this situation, accessing two Process Engines using different databases in Execution Listeners and Service Tasks.
Even though your task is async, I think you'll still have part of your transaction in the Activiti database.
I seperated my code that worked with the external engine/database and explicitly ran it in a seperate thread, either waiting on a synchronised object, or allowing it run async as required - and then all was fine.
Might be worth a try to help understand what is going on at least.
Be interested to know if you've solved it another way, as may be relevant for my case as well.