-->
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: Can I predict the order of flushing encapsulated entities?
PostPosted: Fri Jul 09, 2010 1:35 pm 
Newbie

Joined: Fri Jul 09, 2010 1:24 pm
Posts: 11
Hi all,

Short Version of Question:
Suppose I have an object named Employee. Employ encapsulates other objects such as Address, Supervisor, etc. When changes are made to the Employee and its associations, is the order in which the associated/encapsulated objects stored/flushed predictable or consistent?

More detailed explanation of question:
For example, can one always say that the Address will be updated in the database before the Supervisor, and that the Employee is update/saved last? Or is it possible that this occurs sometimes, while others the Supervisor is updated before the Address? I read in the documentation that the order is determined by the order in which session.save is called, but what if I am only calling session.save once on the Employee and the associated entities are set CASCADE ALL? I am trying to detect events via an interceptor. Based on the intercepted event, I need to fire another event into my application. The problem is I need to ensure that the events I fire happen in a predictable order. Any insight is appreciated.


Thanks,
Julian


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.