title: how spring manage hibernate session lifecycle
body: <p>Spring is used in our team's Java EE project, and hibernate is used for underlying ORM. </p>
  
  <p>transactionManager is set like below:</p>
  
  <pre><code>&lt;bean id="transactionManager"  class="org.springframework.orm.hibernate4.HibernateTransactionManager"&gt;
  &lt;property name="sessionFactory" ref="sessionFactory" /&gt;
  &lt;/bean&gt; 
  </code></pre>
  
  <p>sessionFactory is set like below:</p>
  
  <pre><code>&lt;bean id="sessionFactory"  class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
  &lt;property name="dataSource" ref="dataSource" /&gt;
  &lt;property name="packagesToScan"
  value="com.company.model" /&gt;
  &lt;property name="hibernateProperties"&gt;
  
  &lt;value&gt;
  hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
  hibernate.show_sql=true
  hibernate.jdbc.fetch_size=50
  &lt;/value&gt;
  &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>my quesiton is thoughtout the whole setting, I didn't see any property setting for hibernate session lifecycle.In hibernate reference, Contextual sessions was introduced and it's said that there three implementations of CurrentSessionContext.</p>
  
  <ol>
  <li>JTA 2.Thread 3.Managed</li>
  </ol>
  
  <p>How do I know which implementation has been used.Maybe by Spring, but I've no idea.</p>