title: How does HibernateTemplate and Spring @Transactional work together?
body: <p>We use HibernateTemplate in our DAOs for all the CRUD operations. </p>
  
  <p>My question is, we use spring <code>@Transactional</code> on the services, Because the spring is managing the transactions, how does the <em>HibernateTemplate</em> behave in the senario where I update multiple DAOs. Meaning does <em>HibernateTemplate</em> use same session across  different DAOs when Spring <code>@Transactional</code> is used?</p>
  
  <pre><code>@Transactional
  public boolean testService(SObject test)[
  
       dao1.save(test.getOne());
       dao2.save(test.gettwo());
  
  }
  </code></pre>
  
  <p><br>
  This is how the DAO class looks: </p>
  
  <pre><code>public class GenericHibernateDao&lt;T, PK extends Serializable&gt; extends HibernateDaoSupport
  .
  .
  .
  public PK save(T newInstance) {
      return (PK) getHibernateTemplate().save(newInstance);
  }
  </code></pre>