We are using jboss managed EntityMangerFactory using following spring bean
<jee:jndi-lookup id="entityManagerFactory" jndi-name="persistence-units/myPU"/>
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?
If I define the txmanager like below then can spring will take controll of managing the transction with @Transaction annotation?
<bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName" value="java:/TransactionManager"/>
<property name="userTransactionName" value="UserTransaction"/>
</bean>
If so then when spring will commit the transaction and roll back it?
Thanks