We are using JPA/Hibernate and the Transactions via AOP, however, we are not using any annotations (all JPA configuration is in persitence and orm files and transactions are solely through AOP). The only annotation we are using is on the setEntityManager:
/**
* Sets the entity manager.
*
* @param entityManager
* the new entity manager
*/
@PersistenceContext
public void setEntityManager(final EntityManager entityManager) {
this.entityManager = entityManager;
}
So do I need to use the following configuration capabilities if I am not using annotations for transactions or for JPA mappings?
<tx:annotation-driven transaction-manager="GlobalDataTransactionManager"/>
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
Thanks for your help….jay
You need the
PersistenceAnnotationBeanPostProcessor, but you don’t need the<tx:annotation-driven>:<tx:annotation-driven />registers a proxy around annotated classes. Since you have xml config, you already have the transaction proxies@PersistenceContextannotations on DAOs.