是否可以在一个Spring MVC应用程序中同时使用JpaTransactionManager和HibernateTransactionManager?这段代码看起来像是从entityManagerFactory获取会话工厂。它是一个还是另一个,或者你真的有两个吗?
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="persistenceUnitName" value="spring-jpa" />
</bean>
**<bean id="sessionFactory" factory-bean="entityManagerFactory" factory-method="getSessionFactory" />**
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>