Announcement Announcement Module
No announcement yet.
Child objects and hibernate interceptors Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

          / | \
         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,, or 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,
    Last edited by iksrazal; Jul 9th, 2007, 02:38 PM. Reason: extra sentance trailing