title: Spring JTA Transaction manager question
body: <p>We are using jboss managed EntityMangerFactory using following spring bean</p>
  
  <pre><code>&lt;jee:jndi-lookup id="entityManagerFactory" jndi-name="persistence-units/myPU"/&gt;
  </code></pre>
  
  <p>Now in our spring bean we use @PersistenceContext to get the entitymanager and it works fine. What I want is that how can i tell spring to grab the transaction manager provided by jbos jta service and use it in my dao?</p>
  
  <p>If I define the txmanager like below then can spring will take controll of managing the transction with @Transaction annotation?</p>
  
  <pre><code>&lt;bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager"&gt;
        &lt;property name="transactionManagerName" value="java:/TransactionManager"/&gt;
      &lt;property name="userTransactionName" value="UserTransaction"/&gt;
  &lt;/bean&gt; 
  </code></pre>
  
  <p>If so then when spring will commit the transaction and roll back it?</p>
  
  <p>Thanks</p>