0
我有一個應用程序使用Tomcat/Spring 3/JPA/Hibernate,但我的合併不承諾 datbase。這是配置:entitymanager.merge似乎沒有提交
彈簧conf.xml中:
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost/.." />
<property name="username" value=".." />
<property name="password" value=".." />
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
<context:annotation-config/>
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
</bean>
的persistence.xml:
<persistence-unit name=".." transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
...
<property name="dialect" value="org.hibernate.dialect.MySQLDialect" />
,這是一個簡單的類:
@Transactional
public class UserAdServiceImpl{
...
merge(...);
什麼想法?
當你調用合併時會發生什麼?有什麼異常嗎? – 2010-09-14 05:13:43