-->
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.  [ 1 post ] 
Author Message
 Post subject: Child objects and interceptors
PostPosted: Tue Jul 10, 2007 10:00 am 
Beginner
Beginner

Joined: Fri Apr 15, 2005 3:30 pm
Posts: 46
Location: Fortaleza, Brazil
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.