From the documentation it is clear that the process instance state is persisted whenever a wait state is hit which is great but it means that any progress made before a wait state is encountered would be lost. E.g if in a sync service task I inserted some data into a DB (non-transactional maybe) and the engine crashes between this point and the next wait state then on resume this data will get inserted in the DB again. Is there a way to force a savepoint after performing some work within a service activity?
Maybe for every such non-idempotent action I can make the service task async to force a savepoint? Actually I'm not even sure if it would force a savepoint since a parallel branch might start executing when this branch blocks.
Just looking for best practices or recommendations for these crash/recovery scenarios.. any help would be appreciated!
Thanks