-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: (UPDATED) trigger auto execute "insert" when I using find()
PostPosted: Sun May 16, 2010 11:51 pm 
Newbie

Joined: Sat Apr 12, 2008 12:59 pm
Posts: 10
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.