-->
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.  [ 2 posts ] 
Author Message
 Post subject: Refresh causes assertion failure on OneToMany (cascaded)
PostPosted: Thu Dec 15, 2016 1:09 pm 
Newbie

Joined: Tue Dec 13, 2016 4:52 am
Posts: 7
Hello,

I have a problem with a bidirectional relationship with cascade "all-delete-orphan".

I need to execute a "refresh" to calculate some properties of type "formula" after updating the object.

The problem is that if I add a new element in the collection, after do the refresh Hibernate throws an error "assertion failure" because Hibernate tries to refresh the added object although it is not persistent.

My problem is exactly described in: https://hibernate.atlassian.net/browse/HHH-5133

But I do not arrive to any see any solution.


Any ideas / alternatives would be really appreciated.


Top
 Profile  
 
 Post subject: Re: Refresh causes assertion failure on OneToMany (cascaded)
PostPosted: Thu Dec 15, 2016 1:45 pm 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1638
Location: Romania
It's documented in the [url=http://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibernate_User_Guide.html#pc-refresh-gotchasRefresh gotchas section[/url].

Bottom line, Session.refresh is not meant to be used like an UNDO operation.

_________________
If you liked my answer, you are going to love my High-Performance Java Persistence book and my blog as well.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.