title: How to use JTA support in Tomcat 6 for Hibernate?
body: <p>They recommend using JTA transaction support in Java EE environment.</p>
  
  <p>But how to configure JTA in Tomcat6 so that Hibernate Session could use it ?</p>
  
  <blockquote>
    <p>Starting with version 3.0.1, Hibernate added the <code>SessionFactory.getCurrentSession()</code> method. Initially, this assumed usage of JTA transactions, where the JTA transaction defined both the scope and context of a current session. Given the maturity of the numerous stand-alone JTA TransactionManager implementations, most, if not all, applications should be using JTA  transaction management, whether or not they are deployed into a J2EE container. Based on that, the JTA-based contextual sessions are all you need to use.</p>
  </blockquote>
  
  <p><sup>(<a href="https://docs.jboss.org/hibernate/stable/core.old/reference/en/html/architecture-current-session.html" rel="nofollow noreferrer">Hibernate Reference Documentation | Architecture. Contextual Sessions</a>)</sup></p>