No Entity Manager with actual transaction available for current thread - cannot reliably process 'persist' call
07:39 21 May 2021

From service layer which is annotated as Transactional; another service of an external jar is called which is interacting with DB using entity manager(autowired) . But I am getting this error that "No entity manager with actual transaction available for current thread".

Later I tried to create entity manager manually via EntityManager.getEntityManagerFactory().createEntityManager() which creates the entity manager and then I needed to manually start the transaction also.

My query is : 1. why transaction is not getting propagated to service of external jar. 2. Why autowired EntityManager in external jar is giving error of "No entity manager with actual transaction available for current thread".

spring jpa model-view-controller transactions entitymanager