Hibernate version:
3.2.2
Hi all,
I've got a bit of an unusual use case. I need to send MyEntity to a JMS queue when any change occurs 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.
So I implemented MyEntity with an JMSAware interface (real name not important yet) . And I can gather those objects in a class that implements emptyInterceptor via onSave() and onDirtyFlush() and send those in onFlush() . My problem is these child object changes. My questions are:
1) If I detect changes to Object a,b,c by perhaps the JMSAware interface how do I know its under its own save or flush, and not the save or flush of MyEntity ?
2) If I do a find on MyEntity from the temp session created from the connection I get from onFlush() , from the id's of a,b, or c when those change, 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. There be demons here?
Please help,
Robert