title: closing EntityManager by Spring
body: <p>I have been searching a lot to identify how spring JPA closes EntityManager connection after opening it. I have used @PersistenceContext to inject Transactional EntityManager to my DAOs and this implies that spring will take care of creating and closing EntityManager for me. However in my previous implementation I used to create and close EntityManager from DAOs, which is now replaced using spring. Can anybody please help me to understand, does spring close the EntityManager Connection once transaction is over or it maintain till the application is disposed?</p>
  
  <p>FYI, I am not closing the EntityManager of my own assuming spring will close it for me once transaction is over. I fear if not it will lead to resource leak at some point of time.</p>
  
  <p>Regards
  Rajib</p>