-->
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: Hibernate Session's persist and JPA's persist
PostPosted: Fri Feb 13, 2009 8:07 am 
Beginner
Beginner

Joined: Sat Feb 07, 2009 12:31 am
Posts: 21
Hi,

Could somebody please make some enlightenment to this confusing paragraph:

Quote:
Should I use persist() on the Session? The Hibernate Session interface also
features a persist() method. It has the same semantics as the persist()
operation of JPA. However, there’s an important difference between the
two operations with regard to flushing. During synchronization, a Hibernate
Session doesn’t cascade the persist() operation to associated entities
and collections, even if you mapped an association with this option.
It’s only cascaded to entities that are reachable when you call persist()!
Only save() (and update()) are cascaded at flush-time if you use the
Session API. In a JPA application, however, it’s the other way round:
Only persist() is cascaded at flush-time.


-- Java Persistence with Hibernate page 419

I don't understand the sentence in bold face, it seems to contradict its previous statement.

Does this mean hibernate session's persist() method cascades ONLY to reachable entities whereas JPA EntityManager's persist method cascades more further than just reachable entities?

And just what does "entities that are reachable" mean?

Thanks

-- http://forum.hibernate.org/viewtopic.php?t=994649


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.