Currently, if we execute the following test case:
We can see that the doWork or doReturningWork methods do not trigger a flush when bootstrapping via JPA.
For consistency, just like the Persistence Context is flushed prior to executing any JPA query (e.g., JPQL or native SQL), these two methods should also trigger a flush.
Interesting. Do you have the plan to create a PR in near future? If not I can create one and assign you as the reviewer.
At the moment, I don’t have the time to implement this feature, so feel free to provide a PR for it. I’ll try to review it when it’s done.