-->
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: Detecting changed persistent objects
PostPosted: Thu Aug 04, 2005 6:07 am 
Newbie

Joined: Thu Aug 04, 2005 5:43 am
Posts: 1
Hi,

This thing is beginning to get on my nerves. I'm using Hibernate 2.1.4 and all I'd like to do is to detect when a persistent object has been modified (I don't even need the exact changes). Seems like a straightforward thing, using Interceptor's onFlushDirty method, but it has a drawback that it's not called when changes are made to a Collection "attribute" only, like adding a new object to a one-to-many association.

Now, I've been browsing the forum for hours, encountered this problem in at least ten different places, still I couldn't find a pattern how to get over it. The only workaround I could come up with is to retreive the dirty flag of a collection snapshot, but that's obviously not the way it's meant to be done.

This problem seems so common for me that I still feel like I'm missing something obvious here. So please, anyone, could you show me an example (or a topic that deals with this)?

Thanks,

Matyas


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 04, 2005 8:54 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
Hibernate2 event model is a bit limited.

The best way to solve your problem is to jump to Hibernate3 if you can. The event model is really better and I guess you can solve your problem

If you cannot jump to hibernate3, may your problem be unresolvable.

Seb


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 04, 2005 12:22 pm 
Beginner
Beginner

Joined: Thu Feb 17, 2005 9:20 pm
Posts: 36
Location: Vancouver, WA
We have in our application framework that gives us ability to track an activity on different objects. It is similar to what you want. Once object changed interceptor will report to framework within object context that changes occurred. In case of children stored in collection interceptor will report within context of parent object. For us it works perfectly. It is required to do some work to have something like that implemented. But it is not very hard to get it implemented. If you are not going to H3 it is only way to tell parent changed because of child/children state was changed.

_________________
Vasyl Zhabko


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 05, 2005 2:53 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
Maybe this solution http://hibernate.org/156.html can work for you

seb


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.