Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First of all - do you <em>really</em> need JTA? Typically spring+hibernate don't require it. You can use a simple <code>JpaTransactionManager</code> / <code>HibernateTransactionManager</code>.</p> <p>If you really want JTA, then you will need a JTA provider. If not running in an application server, check <a href="https://stackoverflow.com/questions/2552612/how-to-use-jta-support-in-tomcat-6-for-hibernate">this question</a> for how to use JTA in a servlet container. (Also take a look at <a href="https://stackoverflow.com/questions/117751/spring-jta-transactionmanager-config-supporting-both-tomcat-and-jboss">this question</a>)</p> <p>Finally, <a href="http://community.jboss.org/wiki/sessionsandtransactions#Transactions" rel="nofollow noreferrer">hibernate docs</a> specify that, for container-managed transactions:</p> <blockquote> <p>Declarative transaction demarcation is a standard feature of EJB, also known as container-managed transactions (CMT). In EJB 2.x you would use XML deployment descriptors to create your transaction assembly. In EJB 3.x you can use JDK 5.0 annotation metadata directly in your source code, a much less verbose approach. To enable CMT transaction demarcation for EJBs in Hibernate configuration:</p> <ul> <li>set <code>hibernate.transaction.manager_lookup_class</code> to a lookup strategy for your JEE container</li> <li>set <code>hibernate.transaction.factory_class</code> to <code>org.hibernate.transaction.CMTTransactionFactory</code></li> </ul> </blockquote> <p>The second point is perhaps something you've missed?</p> <p>What the documentation says in addition to that (the next section) is that if you want declarative transaction, hibernate is not where you should look at. You'd need to create an interceptor. That's exactly what spring transaction managers are. And that would be my choice given your technology stack (Spring).</p> <p>If you wish not to rely on a single JTA provider, then make two builds. For example maven has "maven profiles", which allow to make builds for different environments.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload