spring 2.0 m4 0406 JpaDaoSupport +
hibernate 3.2 rc1+
hibernate-entitymanager-3.1beta7+
hibernate-annotations-3.1beta9
delaying identity-insert due to no transaction in progress why?
It can't persistence object.
[org.springframework.orm.jpa.JpaTemplate] - Creating new EntityManager for JPA template execution
[org.hibernate.impl.SessionImpl] - opened session at timestamp: 4687551353470976
[org.hibernate.event.def.AbstractSaveEventListener] - transient instance of: com.shenghuotag.pst.User
[org.hibernate.event.def.DefaultPersistEventListener] - saving transient instance
[org.hibernate.event.def.AbstractSaveEventListener] - saving [com.shenghuotag.pst.User#<null>]
[org.hibernate.event.def.AbstractSaveEventListener] - delaying identity-insert due to no transaction in progress
[org.springframework.orm.jpa.JpaTemplate] - Closing new EntityManager after JPA template execution
[org.hibernate.impl.SessionImpl] - closing session
[org.hibernate.jdbc.ConnectionManager] - connection already null in cleanup : no action
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
<property name="entityManagerName" value="blog" />
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
<property name="jpaDialect" ref="jpaDialect" />
</bean>
<!-- UserDAO: Hibernate implementation -->
<bean id="userDAO" class="com.shenghuotag.dao.UserDAO">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
</beans>