-->
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.  [ 6 posts ] 
Author Message
 Post subject: @PreUpdate is not called
PostPosted: Thu Jul 20, 2006 10:06 am 
Newbie

Joined: Sat May 06, 2006 6:31 am
Posts: 9
Hi all,
I 've specified method with annotation @PreUpdate (as well as @PostPersist, @PostUpdate, @PrePersist), but it is not called. Also I try to do the same with EntityListener class - no effect.
@PostLoad is called.
Method is defined as public void method();
And listener class has empty constructor.
Any ideas what should be configured else?

Thank you.
Igor.

Hibernate version:3.2

Oracle 10


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 20, 2006 1:34 pm 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Are you using EM to do update (persist) or plain Session?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 20, 2006 2:18 pm 
Newbie

Joined: Sat May 06, 2006 6:31 am
Posts: 9
I'm using EntityManager.merge(). I should update detached object, so Icannot use persist


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 20, 2006 6:11 pm 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Any debuging possible?
Since it is all about usage of specific event listeners.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 21, 2006 6:04 pm 
Newbie

Joined: Sat May 06, 2006 6:31 am
Posts: 9
Ok, I find the problem. The @preUpdate wasn't called since the pojo wasn't changed. Actually I wanted to update it in @PreUpdate.
It seems that I need make update in other place.

Thank you.


Top
 Profile  
 
 Post subject: Re: @PreUpdate is not called
PostPosted: Mon Dec 13, 2010 2:53 am 
Newbie

Joined: Tue May 18, 2010 5:39 am
Posts: 19
You can still update the entity in preUpdate .. but not using the entity object attached in the event .. you may want to read http://anshuiitk.blogspot.com/2010/11/h ... event.html for more clarification.

_________________
AG
http://anshuiitk.blogspot.com


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.