commiting the persistence context before reaching the end-state
How do I commit the persistence context within webflow
before reaching the end state? The view-state elements don't have a commit attribute as the end-state element.
I know that you usually do not commit before ending the flow, but in my case I am dealing with a particular flow in which it is convenient to know that changes are committed to the database in a specific view.
I tried to solve this by calling a service method inside the flow. This indeed saves my data, but at the end of the flow
the same data is saved again. I have for example a collection. Objects added to the collection are thus saved 2 times (first in calling the service method, secondly at the end of the flow). This results in duplicate inserts.