-->
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.  [ 4 posts ] 
Author Message
 Post subject: onUpdate not called when object already part of the session
PostPosted: Tue Apr 20, 2004 1:48 am 
Newbie

Joined: Wed Oct 08, 2003 7:42 pm
Posts: 18
If I find a persistent object within a session and update it, even if I explicitly call session.update(obj) the onUpdate method will never run. How can I make the onUpdate method run ever time if I pass it to onUpdate?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 30, 2004 3:09 am 
Newbie

Joined: Tue Apr 20, 2004 4:20 am
Posts: 8
Location: Sydney/Australia
Hi

I have the same problem at the moment. Did you find a solution?

Ralph


Top
 Profile  
 
 Post subject: onUpdate not called when object already part of the session
PostPosted: Thu Jul 01, 2004 9:38 pm 
Newbie

Joined: Wed Oct 08, 2003 7:42 pm
Posts: 18
You need to do one of two things:

1) Do the find in a seperate session so that it is not already associated with the session (what I did)

OR

2) call session.evict(object) before calling session.update(object)

Hope that helps


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 01, 2004 10:03 pm 
Newbie

Joined: Tue Apr 20, 2004 4:20 am
Posts: 8
Location: Sydney/Australia
Cheers I found another solution. Use Interceptors and implement it in the onFlushDirty method. Works fine.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.