-->
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.  [ 3 posts ] 
Author Message
 Post subject: Session.refresh() cascade behavior
PostPosted: Mon Dec 29, 2003 6:36 am 
Newbie

Joined: Mon Dec 29, 2003 6:13 am
Posts: 3
Is there a way to force Session.refresh() to refresh child objects?

I have a parent object that contains a bag of child objects, which each have a Clob. If I save the parent, then refresh(parent) and try to edit one of the children, I get the following error:

java.lang.UnsupportedOperationException: Clob may not be manipulated from creating session.

But... if I refresh(parent), then iterate through the children and call refresh() individually on them, everything's fine. I just *really* don't want to have to do this manually, because I have a dozen classes and they each have a dozen collections, so manually refreshing all of them would get pretty messy.

Here's the general mapping:

<class name="Person">
<bag name="Children" cascade="all-delete-orphan" lazy="true">
<many-to-many class="Person"/>
</bag>
<property name="Comment" type="clob"/>
</class>

Thanks,
--ian


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 31, 2003 6:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
No, refresh() does not cascade.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 31, 2003 6:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Use evict() then load() instead


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

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.