title: Spring+JPA EntityManager injected in service and dao
body: <p>I'm working with <strong>Spring + JPA</strong> (with hibernate as JPA provider) using services and dao.</p>
  
  <p>I'd like to inject the JPA <code>EntityManager</code> in both service and dao, with the service managing the transactions and the dao managing the object persistence.</p>
  
  <p>The dao is <code>@Autowired</code> in the service and the <code>EntityManager</code> is injected both in Service and Dao, with <code>@Autowired</code>.</p>
  
  <p>In this way am I guaranteed to inject the same <code>EntityManager</code> both in the Service and in the dao ?</p>