hihi,
Hibernate
SOMETIME execute "insert" or "update" SQL when I using EntityManager.find() to
search a UserInfo object.
I never call any persist() or merge() method in my program.
(P.S. The insert SQL was generated by "jpa.JpaTransactionManager - triggerAfterCommit()")
System Information:Framework: Spring
Web Server: Tomcat 6.0
Find Method:Code:
@PersistenceContext(type=PersistenceContextType.EXTENDED)
EntityManager entityManager;
...
@Transactional(readOnly=true,propagation=Propagation.REQUIRES_NEW)
public UserInfo findUserInfo(String infoUuid){
return entityManager.find(UserInfo.class,infoUuid);
}
Hibernate generated SQL:Code:
[DEBUG][http-8080-2]jpa.JpaTransactionManager (triggerAfterCommit:906) - Triggering afterCommit synchronization
Hibernate: INSERT INTO USER_INFO (INFO_NAME, INFO_TYPE, UUID) values (?,?,?)
how can I solve this problem?
thank you