-
Jul 9th, 2007, 02:32 PM
#1
Child objects and hibernate interceptors
Hi all,
I've got a bit of an unusual test case. I need to send MyEntity to a JMS queue when any change occurs to any MyEntity or when any child object of MyEntity changes.
Code:
MyEntity
|
/ | \
a b c
There are no further DB changes that need to be made once these changes are detected. However, I think I may need to do a find on a.id, b.id, or c.id for any MyEntity when those changes are detected.
So I implemented MyEntity with an JMSAware interface (real name not important yet) . And I can gather those objects in onSave() and onDirtyFlush() and send those in onFlush() . My problem is these child object changes. My questions are:
1) Anyone done anything like this?
2) If I detect changes to Object a,b,c how do I know its under its own save or flush, and not the save or flush of MyEntity ?
3) If I do a "from MyEntity where a,b,c" (with the right joins of course) from the temp session created from the connection I get from onFlush() , is that legal ? I know the session is fragile in interceptors. Just a find won't create another cycle of save or dirtyFlush I don't think, But what about another transaction?
Please help,
Robert
Last edited by iksrazal; Jul 9th, 2007 at 02:38 PM.
Reason: extra sentance trailing
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules