2

I have Spring Boot App with Batches. I want to start the Baches asynchronously so i am using the SimpleAsyncTaskExecutor for it.

My problem is that the Batches are performing some persistent operations so they need to use the EntityManager - At this point I am getting the exception that my EM is closed. I understand the reason of this exception - my EntityManager is not available for the new Thread i have created.

My question is how to solve it - how do i correctly provide an EM for my batch running in other thread?

swierszczu
  • 21
  • 1

0 Answers0