title: when entitymanager(session) created in spring?
body: <p>i read <a href="https://www.baeldung.com/spring-open-session-in-view" rel="nofollow noreferrer">https://www.baeldung.com/spring-open-session-in-view</a> article</p>
  <p>According to this article, it says that the session is created in the request phase.</p>
  <blockquote>
  <p>Spring opens a new Hibernate Session at the beginning of the request. These Sessions are not necessarily connected to the database.</p>
  </blockquote>
  <p>But as far as I know, in Spring, when a transaction starts, it gets an entity manager (session). The reason is that there is no need to create an entity manager for logic that does not use JDBC.</p>
  <pre class="lang-java prettyprint-override"><code>@Transactional
  @Service
  public class DoService {
        // when use this service EntityManager is created;
  }
  </code></pre>
  <p>I wonder if I'm getting it wrong.</p>